Re: refactoring function handle implementation for version 6

"John W. Eaton" <[email protected]>
Newsgroups gmane.comp.gnu.octave.maintainers
Message-ID <[email protected]>
On 6/11/20 3:33 PM, John W. Eaton wrote:
> On 6/11/20 3:13 PM, Rik wrote:
> 
>> I doubt it gets used very much, but as long as Matlab has it, we could
>> continue to support the behavior for strings and inline function objects
>> alone, no need to extend to function handles.  You could put the
>> vectorize.m in scripts/legacy and have it produce a warning when it is
>> first used.  A prototype example is isdir.m in that directory.
> 
> OK, I'll do that.  It should be easy to also do it for anonymous 
> functions: just check for function handle with class(), determine 
> whether it is an anonymous function and get the text of the function 
> body with functions().  Then apply the same transformation as we use for 
> inline functions to that string, then return a new function handle 
> constructed from that string.

I pushed two changes to restore this function:

   https://hg.savannah.gnu.org/hgweb/octave/rev/925c169a4958
   https://hg.savannah.gnu.org/hgweb/octave/rev/53d8e7ca99c5

It's in legacy instead of deprecated because like the other "legacy" 
functions, it is still part of Matlab so there's no way to know when we 
can remove it.

I forgot to include the warning discouraging its use.  And now I see 
that genvarname also lacks a warning.  Should they all have warnings? 
Should the inline constructor also issue a legacy function warning?

jwe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.