# HG changeset patch # User John W. Eaton # Date 1584640443 14400 # Node ID 087bccd1ab494af041ddacdf5449b4f449cdc2ad # Parent 7567413e7246e0ee32fa50b4e46f3d455bf6bba7 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". diff -r 7567413e7246 -r 087bccd1ab49 libinterp/octave-value/ov-fcn-handle.h --- a/libinterp/octave-value/ov-fcn-handle.h Wed Apr 08 15:59:56 2020 -0400 +++ b/libinterp/octave-value/ov-fcn-handle.h Thu Mar 19 13:54:03 2020 -0400 @@ -97,6 +97,8 @@ bool is_function_handle (void) const { return true; } + bool is_anonymous (void) const { return m_name == anonymous; } + bool is_nested (void) const { return m_is_nested; } dim_vector dims (void) const; diff -r 7567413e7246 -r 087bccd1ab49 libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Wed Apr 08 15:59:56 2020 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.cc Thu Mar 19 13:54:03 2020 -0400 @@ -792,9 +792,8 @@ if (func.is_function_handle ()) { octave_fcn_handle *fh = func.fcn_handle_value (); - std::string fh_nm = fh->fcn_name (); - if (fh_nm == octave_fcn_handle::anonymous) + if (fh->is_anonymous ()) return ovl (-1); }