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: Mon, 31 Jul 2017 12:06:51 -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 #7, bug #51586 (project octave):

Thanks for taking your time to look at my ideas and the few lines of code I
wrote!

For my needs the approach you suggested (that is closing this bug) is
sufficient. However, I believe that in that case the error message needs to be
changed. 

With this class:
 
classdef creating_method_handle < handle
  methods
    function foo (self)
      1;
    end
    function tst1 (self)
      f = @foo; % or str2func('foo') or str2func('@foo')
      f(self);
    end  
  end
end


When calling 

a = creating_method_handle;
a.tst1();


The response from the interpreter is:

@foo: no function and no method found


This behavior suggests that it should be possible to create a method handle.
If it is undesirable to create a method handle *anywhere* then the error
message should be changed as well.

Because of this error message and the fact that someone had implemented
parsing for creating a method handle within
libinterp/octave-value/ov-fcn-handle.cc:make_fcn_handle() I will bring it up
on the mailing list.

    _______________________________________________________

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]