bugGNU Octave - Bugs: bug #45969, Inner scopes of nested anonymous...


bug #45969: Inner scopes of nested anonymous function definitions are not saved.

Submitted by:  Olaf Till <i7tiol>
Submitted on:  Tue 15 Sep 2015 08:51:13 AM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Patch Submitted Assigned to:  None
Originator Name:  Olaf Till Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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).

Olaf Till <i7tiol>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #34887:  bug-45969.cset added by i7tiol (19KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by i7tiol (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-08 mtmiller StatusNone => Patch Submitted
    2015-09-15 i7tiol Attached File- => Added bug-45969.cset, #34887

    Back to the top

    Powered by Savane 3.3