help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best replacement for curr_sym_tab in octave 3.2


From: John W. Eaton
Subject: Re: Best replacement for curr_sym_tab in octave 3.2
Date: Mon, 4 Jan 2010 01:21:03 -0500

On  2-Jan-2010, Joshua Redstone wrote:

| It looks like the following may work:
|     symbol_table::set_scope(symbol_table::top_scope());
| at least, it compiles... :)
| Josh
| 
| On Sat, Jan 2, 2010 at 1:50 PM, Joshua Redstone <address@hidden> wrote:
| 
| > Hi,
| > The octave-ruby gem currently does not compile with octave 3.2.2.
| > It looks like the compilation errors are cause by the first line below:
| >
| > ....
| > curr_sym_tab = top_level_sym_tab;
| > reset_error_handler();
| > octave_value_list val = feval(std::string(RSTRING(function_name)->ptr),
| > argList, 1);
| > .....

Are you trying to do the equivalent of

  evalin ("base", "function_name")

?  If so, then I don't see the point of switching to the top
level symbol table unless "function_name" refers to a script file.

If you are calling a script and you want it to be evaluated in the
base workspace, then maybe it would be better to just use Fevalin
directly:

  extern octave_value_list Fevalin (const octave_value_list&, int);
  ...
  octave_value_list args (2);
  args(0) = "base";
  args(1) = std::string (RSTRING(function_name)->ptr);
  octave_value_list val = Fevalin (args, 1);

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]