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

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

[Octave-bug-tracker] [bug #58523] nested functions called through anonym


From: Daniel Molina García
Subject: [Octave-bug-tracker] [bug #58523] nested functions called through anonymous functions forget variables in parent function
Date: Sun, 7 Jun 2020 09:35:35 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

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

                 Summary: nested functions called through anonymous functions
forget variables in parent function
                 Project: GNU Octave
            Submitted by: dmolina
            Submitted on: Sun 07 Jun 2020 01:35:33 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Example to reproduce it:

Consider the following function file:


function out = f ()
  v = 3;
  function out2 = fnested()
    out2 = v;
  endfunction
  h = @() fnested();
  h();
endfunction


and call it from octave


octave:1> f()
error: 'v' undefined near line 4, column 4
error: called from
    f>fnested at line 4 column 10
    f>@<anonymous> at line 6 column 12
    f at line 7 column 3


It was working in 5.2.0.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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