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

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

[Octave-bug-tracker] [bug #60237] Differente behaviour in anonymous func


From: anonymous
Subject: [Octave-bug-tracker] [bug #60237] Differente behaviour in anonymous function handling
Date: Fri, 2 Apr 2021 12:44:09 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:68.9) Gecko/20100101 Goanna/4.6 Firefox/68.9 Mypal/28.14.2

Follow-up Comment #23, bug #60237 (project octave):

Interesting! My opinion was that when f() is called 'd' is out of scope.
Possibly this should produce [2 3] :


function r = bug_60237 ()

  f = ancall (2);

  r = [f(), f()];

end


function r = ancall (a)

  d = 2;

  function c = bm (a)

    c = d;

    d = d+1;

  end

  r = @() bm (a);

end



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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