Tue 15 Sep 2015 08:51:13 AM UTC, original submission:
Anonymous functions handles contain an own scope with the variables they inherited from the parent scope. If anonymous function handles are saved (ascii, binary, or hdf5), the variables of this scope are also saved. But currently, if anonymous function definitions are nested (e.g.
), the variables in the scopes of the 'inner' anonymous functions (variable 'a' in
in the example) are not saved.
Simple example for triggering this bug:
More realistic example for triggering this bug:
The fix (single changeset to be attached as soon as I know the bug number) firstly provides a new class, derived from class tree_walker, to collect the variables of all scopes of potentially nested anonymous function handles, secondly lets the
methods use this class for saving anonymous functions, and thirdly provides a test (with the second example above).
|