[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: embedding octave 3.2.0
From: |
Jaroslav Hajek |
Subject: |
Re: embedding octave 3.2.0 |
Date: |
Mon, 15 Jun 2009 13:10:03 +0200 |
On Mon, Jun 15, 2009 at 12:55 PM, Soeren Sonnenburg<address@hidden> wrote:
> 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...
>
The bug was discovered shortly after 3.2.0. In 3.2.1, it should be
working. If you have a counterexample, please submit a bug report.
> 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).
Of course not. The latter work with current scope.
> Are {get,set}global_value() no longer functional (I was using them
> before...)?
It does not seem so.
> 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?
is_variable will return true if a variable is visible in local scope,
including global variables.
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz