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: Glite
Subject: [Octave-bug-tracker] [bug #59344] Run source('filename.m', 'caller') and Get a 'base' Context
Date: Sat, 24 Oct 2020 19:49:56 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

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

                 Summary: Run source('filename.m','caller') and Get a 'base'
Context
                 Project: GNU Octave
            Submitted by: linuxbckp
            Submitted on: Sat 24 Oct 2020 11:49:54 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

I designed three programs to test this bug:
*File:* callit.m

a(i)

*File:* a.m

function o=a(i) 
    fprintf("here, i=%d\n",i)
endfunction

*File:* b.m

function o=b(i) 
    i+=3;
    callit 
    source('callit.m','base') 
    source('callit.m','caller') 
endfunction

Then execute this chain:

>> i=1
i =  1
>> b(3)
here, i=6
here, i=1
here, i=1

It seems that calling source() function with 'base' and 'caller' parameter has
the same result, but var i should be changed in '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]