Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/dispatch.cc @ 11225:8d8e10058df6
move builtin function from dispatch.cc to oct-parse.yy
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Nov 2010 16:09:07 -0500 |
parents | cc3aad9dd3ef |
children |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/dispatch.cc Wed Nov 10 22:03:58 2010 +0100 +++ b/src/DLD-FUNCTIONS/dispatch.cc Wed Nov 10 16:09:07 2010 -0500 @@ -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\