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

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

[Octave-bug-tracker] [bug #59344] Run source('filename.m', 'caller') and


From: Rik
Subject: [Octave-bug-tracker] [bug #59344] Run source('filename.m', 'caller') and Get a 'base' Context
Date: Sun, 25 Oct 2020 18:45:37 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36

Update of bug #59344 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:       Microsoft Windows => Any                    

    _______________________________________________________

Follow-up Comment #1:

This is correct behavior.  When you execute "b(3)" the "caller" context is the
same as the "base" context since "b(3)" is called from the Octave prompt. 
Since they are the same context, they must return the same results.

Also, there is no change to the variable "i" because the script callit.m makes
no assignment to it.

If I modify callit.m to


i = i + 1;
a(i)


and then execute


octave:7> i = 1
i = 1
octave:8> b(3)
here, i=7
here, i=2
here, i=3
octave:9> i
i = 3


you can see that variables are changed in the base and caller context.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59344>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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