# HG changeset patch # User Jaroslav Hajek # Date 1280854914 -7200 # Node ID f1a45913662ac716016605bb7e84a573cccdf5c1 # Parent d782d7b524a655e6dbe772f36bc458fb3088aa6c propagate isargout info through function handles diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2010-08-03 Jaroslav Hajek + + * ov-fcn-handle.cc + (octave_value::subsref (..., const std::list *) + octave_value::do_multi_index_op (..., const std::list *)): + New methods. Move code here. + * ov-fcn-handle.h: Declare them. + 2010-08-03 Jaroslav Hajek * ov-usr-fcn.cc (Fis_ignored_output): Rename to Fisargout. Change the diff --git a/src/ov-fcn-handle.cc b/src/ov-fcn-handle.cc --- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -85,6 +85,14 @@ const std::list& idx, int nargout) { + return octave_fcn_handle::subsref (type, idx, nargout, 0); +} + +octave_value_list +octave_fcn_handle::subsref (const std::string& type, + const std::list& idx, + int nargout, const std::list* lvalue_list) +{ octave_value_list retval; switch (type[0]) @@ -93,7 +101,8 @@ { int tmp_nargout = (type.length () > 1 && nargout == 0) ? 1 : nargout; - retval = do_multi_index_op (tmp_nargout, idx.front ()); + retval = do_multi_index_op (tmp_nargout, idx.front (), + idx.size () == 1 ? lvalue_list : 0); } break; @@ -123,6 +132,14 @@ octave_fcn_handle::do_multi_index_op (int nargout, const octave_value_list& args) { + return do_multi_index_op (nargout, args, 0); +} + +octave_value_list +octave_fcn_handle::do_multi_index_op (int nargout, + const octave_value_list& args, + const std::list* lvalue_list) +{ octave_value_list retval; out_of_date_check (fcn, std::string (), false); @@ -153,9 +170,9 @@ } if (ov_fcn.is_defined ()) - retval = ov_fcn.do_multi_index_op (nargout, args); + retval = ov_fcn.do_multi_index_op (nargout, args, lvalue_list); else if (fcn.is_defined ()) - retval = fcn.do_multi_index_op (nargout, args); + retval = fcn.do_multi_index_op (nargout, args, lvalue_list); else error ("%s: no method for class %s", nm.c_str (), dispatch_type.c_str ()); } @@ -163,7 +180,7 @@ { // Non-overloaded function (anonymous, subfunction, private function). if (fcn.is_defined ()) - retval = fcn.do_multi_index_op (nargout, args); + retval = fcn.do_multi_index_op (nargout, args, lvalue_list); else error ("%s: no longer valid function handle", nm.c_str ()); } diff --git a/src/ov-fcn-handle.h b/src/ov-fcn-handle.h --- a/src/ov-fcn-handle.h +++ b/src/ov-fcn-handle.h @@ -83,9 +83,17 @@ const std::list& idx, int nargout); + octave_value_list subsref (const std::string& type, + const std::list& idx, + int nargout, const std::list* lvalue_list); + octave_value_list do_multi_index_op (int nargout, const octave_value_list& args); + octave_value_list + do_multi_index_op (int nargout, const octave_value_list& args, + const std::list* lvalue_list); + bool is_defined (void) const { return true; } bool is_function_handle (void) const { return true; }