Mercurial > octave
comparison libinterp/octave-value/ov-usr-fcn.cc @ 28197:087bccd1ab49 stable
new function to identify anonymous function handles
* ov-fcn-handle.h (octave_fcn_handle::is_anonymous): New function.
* ov-usr-fcn.cc (Fnargout): Use it instead of checking whether
function handle name is "anonymous".
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Mar 2020 13:54:03 -0400 |
parents | bd51beb6205e |
children | 9a3deb17b4ea |
comparison
equal
deleted
inserted
replaced
28195:7567413e7246 | 28197:087bccd1ab49 |
---|---|
790 return ovl (1); | 790 return ovl (1); |
791 | 791 |
792 if (func.is_function_handle ()) | 792 if (func.is_function_handle ()) |
793 { | 793 { |
794 octave_fcn_handle *fh = func.fcn_handle_value (); | 794 octave_fcn_handle *fh = func.fcn_handle_value (); |
795 std::string fh_nm = fh->fcn_name (); | 795 |
796 | 796 if (fh->is_anonymous ()) |
797 if (fh_nm == octave_fcn_handle::anonymous) | |
798 return ovl (-1); | 797 return ovl (-1); |
799 } | 798 } |
800 | 799 |
801 octave_function *fcn_val = func.function_value (true); | 800 octave_function *fcn_val = func.function_value (true); |
802 if (! fcn_val) | 801 if (! fcn_val) |