Description
This may be very easy in composition language V2. The object returned by Z812/Tail could attach its scope to the previous frame, rather than retaining the scope of the call to Z812. That way, arbitrary numbers of calls to Z812/Tail would produce an object parented to the same stack frame, obviating stack frame growth when iterating over a list.
In future, we might even allow user-defined functions to describe themselves as tail calls, allowing for any function to take advantage of this behavior.
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- return value of Z812/Tail should be attached to parent scope, not the current scope
- stack size should no longer grow when using Z812/Tail to iterate over a list
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist