# HG changeset patch # User John W. Eaton # Date 1289423347 18000 # Node ID 8d8e10058df65c39aa9d090c6271ac1f85845b40 # Parent e0db3f9e926799b4f7adf8611756902d8f650273 move builtin function from dispatch.cc to oct-parse.yy diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-11-10 John W. Eaton + + * oct-parse.yy (Fbuiltin): Move here from DLD-FUNCTIONS/dispatch.cc. + 2010-11-10 Kai Habel * fltk-backend.cc (update_accelerator), (update_callback), (update_enable), diff --git a/src/DLD-FUNCTIONS/dispatch.cc b/src/DLD-FUNCTIONS/dispatch.cc --- a/src/DLD-FUNCTIONS/dispatch.cc +++ b/src/DLD-FUNCTIONS/dispatch.cc @@ -40,41 +40,6 @@ #include "symtab.h" #include "variables.h" -DEFUN_DLD (builtin, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {[@dots{}]} builtin (@var{f}, @dots{})\n\ -Call the base function @var{f} even if @var{f} is overloaded to\n\ -some other function for the given type signature.\n\ -@seealso{dispatch}\n\ -@end deftypefn") -{ - octave_value_list retval; - - int nargin = args.length (); - - if (nargin > 0) - { - const std::string name (args(0).string_value ()); - - if (! error_state) - { - octave_value fcn = symbol_table::builtin_find (name); - - if (fcn.is_defined ()) - retval = feval (fcn.function_value (), args.splice (0, 1), - nargout); - else - error ("builtin: lookup for symbol `%s' failed", name.c_str ()); - } - else - error ("builtin: expecting function name as first argument"); - } - else - print_usage (); - - return retval; -} - DEFUN_DLD (dispatch, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} dispatch (@var{f}, @var{r}, @var{type})\n\ diff --git a/src/oct-parse.yy b/src/oct-parse.yy --- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -4231,6 +4231,41 @@ return retval; } +DEFUN (builtin, args, nargout, + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {[@dots{}]} builtin (@var{f}, @dots{})\n\ +Call the base function @var{f} even if @var{f} is overloaded to\n\ +some other function for the given type signature.\n\ +@seealso{dispatch}\n\ +@end deftypefn") +{ + octave_value_list retval; + + int nargin = args.length (); + + if (nargin > 0) + { + const std::string name (args(0).string_value ()); + + if (! error_state) + { + octave_value fcn = symbol_table::builtin_find (name); + + if (fcn.is_defined ()) + retval = feval (fcn.function_value (), args.splice (0, 1), + nargout); + else + error ("builtin: lookup for symbol `%s' failed", name.c_str ()); + } + else + error ("builtin: expecting function name as first argument"); + } + else + print_usage (); + + return retval; +} + octave_value_list eval_string (const std::string& s, bool silent, int& parse_status, int nargout) {