octave-maintainers
[Top][All Lists]
Advanced

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

Re: refactoring function handle implementation for version 6


From: John W. Eaton
Subject: Re: refactoring function handle implementation for version 6
Date: Thu, 11 Jun 2020 16:51:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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




reply via email to

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