--- octave-2.1.34/src/parse.cc.orig Thu Jan 11 10:12:14 2001 +++ octave-2.1.34/src/parse.cc Sun Jan 28 18:11:41 2001 @@ -4904,6 +4904,50 @@ return retval; } + +DEFUN (leval, args, nargout, + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} leval (@var{name}, @var{list})\n\ +Evaluate the function named @var{name}. All the elements in @var{list}\n\ +are passed on to the named function. For example,\n\ +\n\ +@example\n\ +leval (\"acos\", list (-1))\n\ + @result{} 3.1416\n\ +@end example\n\ +\n\ +@noindent\n\ +calls the function @code{acos} with the argument @samp{-1}.\n\ +\n\ +The function @code{leval} provides provides more flexibility than\n\ +@code{feval} since arguments need not be hard-wired in the calling \n\ +code. @seealso{feval and eval}\n\ +@end deftypefn") +{ + octave_value_list retval; + + int nargin = args.length (); + + if (nargin == 2) + { + std::string name = args(0).string_value (); + if (error_state) + error ("leval: first argument must be a string"); + + octave_value_list lst = args(1).list_value (); + if (error_state) + error ("leval: second argument must be a list"); + + retval = feval (name, lst, nargout); + + } + else + print_usage ("leval"); + + return retval; +} + + octave_value_list eval_string (const std::string& s, bool silent, int& parse_status, int nargout) {