[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: embedding octave 3.2.0
From: |
Soeren Sonnenburg |
Subject: |
Re: embedding octave 3.2.0 |
Date: |
Mon, 15 Jun 2009 12:55:20 +0200 |
On Fri, 2009-06-12 at 12:23 +0200, Jaroslav Hajek wrote:
> On Fri, Jun 12, 2009 at 12:15 PM, John W. Eaton<address@hidden> wrote:
> > On 12-Jun-2009, Jaroslav Hajek wrote:
> >
> > | Hmm, I see symbol_table::clear_global_pattern only clears global
> > | variables (matching the pattern) visible in current scope. Is that
> > | expected?
> >
> > It looks to me like it also clears variables that match the pattern
> > from the global scope. Does it not work correctly?
> >
> > jwe
> >
>
> Yes, I'm silly, I even fixed it myself (9315).
> So, clear_global_pattern ("*") is another alternative, though that
> also clears the global symbols from local scope.
Dear John and Jaroslav,
thanks for all your help.
I just found the time to attempt the conversion octave 3.0 -> 3.0. It is
still not 100% working though, at least not the way you both described:
Neither
symbol_table::clear_global_pattern ("*");
nor
static inline void clear_octave_globals()
{
string_vector gvars = symbol_table::global_variable_names();
int gcount = gvars.length();
for (int i = 0; i < gcount; i++)
symbol_table::clear_global(gvars[i]);
}
really clears the global variables. However,
eval_string("clear all", false, parse_status);
does...
I am also a bit puzzled that set_global_value(var_name, ... ) and
get_global_value(var_name) don't seem to have the same effect as
symbol_table::varref(var_name) and symbol_table::varval(var_name).
Are {get,set}global_value() no longer functional (I was using them
before...)?
Finally, do I assume correctly that I can use
symbol_table::is_variable(var_name) to figure out that var_name is not a
global variable?
Best regards,
Soeren
--
For the one fact about the future of which we can be certain is that it
will be utterly fantastic. -- Arthur C. Clarke, 1962