# HG changeset patch # User Eugenio Gianniti # Date 1403882951 -7200 # Node ID e51dba005f87621ad35e1a67a89da29b99442283 # Parent 958a0e0e8102c6147cbf631864569199cc8ad644 Add evaluation through anonymous functions diff -r 958a0e0e8102 -r e51dba005f87 src/function.h --- a/src/function.h Wed Jun 25 22:32:38 2014 +0200 +++ b/src/function.h Fri Jun 27 17:29:11 2014 +0200 @@ -89,9 +89,7 @@ { case '(': { - std::list args (idx); - args.push_front (octave_value (new function (*this))); - retval = feval ("feval", args, nargout); + retval = do_multi_index_op (nargout, idx.front ()); } break; @@ -110,6 +108,16 @@ return retval; } + octave_value_list + do_multi_index_op (int nargout, const octave_value_list& idx) + { + octave_value_list retval; + std::list args (1, idx); + args.push_front (octave_value (new function (*this))); + retval = feval ("feval", args, nargout); + return retval; + } + private: std::string str;