octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function handles & dispatch


From: Judd Storrs
Subject: Re: function handles & dispatch
Date: Thu, 25 Jun 2009 04:31:01 -0400

On Thu, Jun 25, 2009 at 2:59 AM, David Bateman <address@hidden> wrote:
Function  handles or pointers to functions have existed in C from the very begin.. X11 GC graphic contexts are full of them and have been for the last 25 years.. I would think this patent would be hard to defend from a prior art point of view

My reading of the patent is that it definitely isn't really about function pointers. I don't know if you've scanned the patent, but the key combination of features seem to be "dynamic typing", "function overloading" and "lookup by name" where the dispatch table is evaluated and stored by function name at an initial some point in one context and then evaluated based on the initial dispatch later in a different context.

I looked into IDL first but I don't think it applies. IDL is an "incremental compiler" and I don't think IDL can manage more than one definition per function. The first time you use a function or proceedure in the session it is compiled to VM code. After it's been compiled in memory, changes to the source files aren't seen unless you explicitly tell the interpreter to recompile that function's file or reset the session. IDL uses object->functon(arg) stlye OO syntax so overloading by function name isn't really needed. There is an equivalent to feval() and another one for calling methods on objects by name as a string. I don't remember there being a mechanism for anomymous functions. I'm pretty sure that in IDL there is only ever one function definition at a time and there is no overloading.

I've also been looking into whether R or S are prior art for this. I'm not a very sophisticated R user but there are many similarities. R is a dynamic numerical language that has overloaded functions with a very similar object method syntax (i.e. in R methods are invoked on objects as func(obj,args) just as in octave/Matlab). R predates this patent by a decade at least and is based on S+ which is even older, and I don't know when objects first appeared in S. However, dispite these similarities I've not been able to find any indication that R has a function reference mechanism similar to Matlab's @func where the function and scope are fixed at creation. i.e. I don't know if you can have two function references in R created in different scopes and then evaluate then later in the same third scope and get a different dispatch. Like I said I'm not a sophisticated R user, so I'm still poking around.


--judd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]