Creating classdef method handles

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Creating classdef method handles

Piotr Held
Hello all!

I have created a bug report Bug #51586 that deals with creating a function handle to a classdef method.

Should this feature be supported? If yes, what should be the syntax?

In Octave 4.0.3 (and maybe later), the syntax str2func('@class/method') worked (there is some test code for this on the bug tracker). I submitted a one-line patch (also on bug tracker) that restores this functionality. This was possible due to the parsing already built into libinterp/octave-value/ov-fcn-handle.cc:make_fcn_handle(). Should that syntax be supported?
(Kai Torben Ohlhus thinks, for multiple valid reasons, that it should not, as he has stated on the bug tracker)

If not, should any syntax that creates method handles be supported?
(for instance 'fcn_handle = @method' placed within another method of the same class)

If not, then should the error message be different when trying to create a method handle and not include "no method found"? (please reference bug tracker for code example)

Piotr
Loading...