octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51586] Creating method handle fails using str


From: Piotr Held
Subject: [Octave-bug-tracker] [bug #51586] Creating method handle fails using str2func
Date: Fri, 28 Jul 2017 20:13:07 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36

Follow-up Comment #3, bug #51586 (project octave):

It is *not* matlab compatible. 

As far as I could tell Matlab resolves fcn_handles at runtime so if you have
two classes with the same method name (let's call it 'foo') Matlab will let
you:


a = class1;
b = class2;
fcn_handle = str2func('foo'); %str2func('@foo') or @foo also work
fcn_handle(a);
fcn_hanlde(b);

and each time the proper method is called for each class.

With Octave the fcn_handles are resolved at assignment so the function you are
pointing to must be visible to the interpreter when you create the handle.
Matlab only checks if the handle makes sense when you use it.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51586>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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