Closed nsensfel closed 1 year ago
These variables would not be allowed to have any lambda functions member, nor procedures, nor pointers to non-shared variables.
Following the ideas presented in issue https://github.com/nsensfel/tonkadur/issues/44, this would no longer be a problem. addresses (and lambda functions) should have their narrative stack index included, making references to memory from narratives that have not been deleted acceptable.
(end)
would thus delete all memory elements but these, and (initialize ...) should do the "do not change if it already exists" thing.
(end)
should still end everything. Use (narrative:pop)
and its variants to keep memory.
The issue is now merged with https://github.com/nsensfel/tonkadur/issues/44.
Currently, there is nothing put in place to facilitate using the same memory elements over multiple narratives. To do this manually, one would simply add "delete all memory elements whose name starts with
.
" to the(end)
instruction and "do not change value if it already exists" to the(initialize ...)
instruction. While it can work, it's definitely an unsafe hack:To make this more user-friendly, we could add
(shared [TYPE] {String})
alternative to(global [TYPE] {String})
, which would denote variables that are shared across multiple narratives. These variables would not be allowed to have any lambda functions member, nor procedures, nor pointers to non-shared variables.(end)
would thus delete all memory elements but these, and(initialize ...)
should do the "do not change if it already exists" thing.