octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #38236] invoking script in demo block to defin


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #38236] invoking script in demo block to define variables causes errors
Date: Fri, 15 Jan 2016 23:30:05 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #18, bug #38236 (project octave):

Since jwe said regressions are high priority bugs, I'm looking into this.

The problem seems to be that df_vr creates a vr symbol in the context of
__demo__, but that symbol isn't cleared when __demo__ is.  Issuing "who" just
after "v=7" in df_vr doesn't return anything the second time around.  The
assignment is to the original symbol (it consistently has the same "this"
address) but that symbol is not found in the context of the new __demo__.

The problem goes away if "clear -f df_vr" is issued when "clear __demo__" is
issued.

Debugging this is made hard by my lack of understanding of how things are
*supposed* to work.  I had assumed that variables are created on the fly
during a function, but it seems that they are all created when the file is
parsed and instantiated with <unknown value>.  I assume that this is to avoid
a string-based look-up for every variable reference, right?  How is reuse of
the script in different contexts supposed to work?

Each symbol seems to have its own value_stack indexed by context.  Is context
numbered sequentially in the number of stack frames?  I assume that there
isn't a value of each symbol for each stack frame, just the ones in which the
variable occurs, right?  If so, are there "gaps" in the value_stack?

Thanks for your help!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38236>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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