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

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

[Octave-bug-tracker] [bug #35772] Nested Function Support


From: Alon Levy
Subject: [Octave-bug-tracker] [bug #35772] Nested Function Support
Date: Sat, 17 Mar 2012 01:24:51 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

Follow-up Comment #3, bug #35772 (project octave):

OK, great to know. So you might want to use the following test, your first
patch fails it: (fails the first, second is same just using a rename to
pinpoint the error - it seems the nested f redefined x, and in your
do_update_nested I think you unmark x as nonlocal, but forget to mark it back
as normal (or maybe the unmark is not being called), thereby causing it to be
unresolved in the parent function (just a theory, didn't check yet - and if
your revised patch would be available in a day or two I will patiently wait
:)

octave:1> function test(x); function f(x); endfunction; f(x); disp(x);
endfunction
octave:2> test(11)
error: `x' undefined near line 1 column 58
error: evaluating argument list element number 1
error: called from:
error:   test at line 1, column 53
octave:2> function test(x); function f(y); endfunction; f(x); disp(x);
endfunction
octave:3> test(11)
 11


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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