Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing memory over multiple narratives #20

Closed
nsensfel opened this issue Jan 3, 2021 · 1 comment
Closed

Sharing memory over multiple narratives #20

nsensfel opened this issue Jan 3, 2021 · 1 comment
Assignees
Labels
design enhancement New feature or request fate Issues relating to the Fate language wyrd Issues relating to the Wyrd language

Comments

@nsensfel
Copy link
Owner

nsensfel commented Jan 3, 2021

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:

  • Lambda functions will not work across multiple narratives.
  • "Stored" procedures won't work either.
  • Every single "global" variable of the previous script must either not be used, or be given the exact same type.

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.

@nsensfel nsensfel added enhancement New feature or request design fate Issues relating to the Fate language wyrd Issues relating to the Wyrd language labels Jan 3, 2021
@nsensfel nsensfel added this to the V2 - Release Candidate 0 milestone Jan 3, 2021
@nsensfel nsensfel self-assigned this Jan 3, 2021
@nsensfel
Copy link
Owner Author

nsensfel commented Oct 3, 2023

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 #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 #44.

@nsensfel nsensfel closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design enhancement New feature or request fate Issues relating to the Fate language wyrd Issues relating to the Wyrd language
Projects
None yet
Development

No branches or pull requests

1 participant