[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #39257] handles to nested functions are not ye
From: |
CH |
Subject: |
[Octave-bug-tracker] [bug #39257] handles to nested functions are not yet supported |
Date: |
Tue, 3 Apr 2018 10:44:42 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 |
Follow-up Comment #18, bug #39257 (project octave):
Hi,
thanks for working on this. I tested this and got an error on the example in
comment #11. running the function testnested works, also a function handle is
returned correctly, yet calling the returned handle gives an error:
octave:2> y = testnested;
octave:3> y()
error: 'y' undefined near line 7 column 8
error: called from
testnested>nested at line 7 column 3
It seems the variable "a" in the enclosing (closure generating) function went
out of scope and is destroyed(?). As far as I understand it Matlab stores a
copy of the closure generating function's "workspace" to prevent this until
all references to the handle are deleted.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39257>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/