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 1:41 PM, Rik wrote:

> Also, it seems that vectorize() has gone away in Octave, but it still 
> exists in Matlab when applied to function handles.  The following code works
> 
> f = @(x,y) x * y
> f = function handle with value:
>     @(x,y)x*y
> f2 = vectorize (f)
> f2 = function handle with value:
>     @(x,y)x.*y

The Matlab docs mark vectorize as "not recommended" and only state that 
the input can be a character vector, string scalar, or inline function 
object.

Octave's vectorize function has always been bad.  For example, try

   vectorize ("fprintf ('the file is: /foo/bar\n')")

in an old version.

If you think it is worth doing, I could probably restore the old buggy 
behavior for anonymous function handles and character strings.

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.