diff libinterp/corefcn/daspk.cc @ 23699:b29904962d2d

deprecate some global functions that access the symbol table * variables.h, variables.cc (clear_mex_functions, clear_function, clear_variable, clear_symbol, lookup_function_handle, get_global_value, set_global_value, get_top_level_value, set_top_level_value): Deprecate. Eliminate all uses in Octave.
author John W. Eaton <jwe@octave.org>
date Mon, 26 Jun 2017 14:31:07 -0400
parents c3075ae020e1
children 980f39c3ab90
line wrap: on
line diff
--- a/libinterp/corefcn/daspk.cc	Mon Jun 26 13:58:58 2017 -0400
+++ b/libinterp/corefcn/daspk.cc	Mon Jun 26 14:31:07 2017 -0400
@@ -154,8 +154,8 @@
   return retval;
 }
 
-DEFUN (daspk, args, nargout,
-       doc: /* -*- texinfo -*-
+DEFMETHOD (daspk, interp, args, nargout,
+           doc: /* -*- texinfo -*-
 @deftypefn {} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} daspk (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
 Solve the set of differential-algebraic equations
 @tex
@@ -270,6 +270,8 @@
   frame.protect_var (call_depth);
   call_depth++;
 
+  octave::symbol_table& symtab = interp.get_symbol_table ();
+
   if (call_depth > 1)
     error ("daspk: invalid recursive call");
 
@@ -314,7 +316,7 @@
                   if (! daspk_jac)
                     {
                       if (fcn_name.length ())
-                        clear_function (fcn_name);
+                        symtab.clear_function (fcn_name);
                       daspk_fcn = 0;
                     }
                 }
@@ -368,7 +370,7 @@
                     if (! daspk_jac)
                       {
                         if (fcn_name.length ())
-                          clear_function (fcn_name);
+                          symtab.clear_function (fcn_name);
                         daspk_fcn = 0;
                       }
                   }
@@ -416,9 +418,9 @@
     output = dae.integrate (out_times, deriv_output);
 
   if (fcn_name.length ())
-    clear_function (fcn_name);
+    symtab.clear_function (fcn_name);
   if (jac_name.length ())
-    clear_function (jac_name);
+    symtab.clear_function (jac_name);
 
   std::string msg = dae.error_message ();