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

Remove the ability to create global variables outside of corelib #134

Open
liquidev opened this issue Jan 29, 2023 · 1 comment
Open

Remove the ability to create global variables outside of corelib #134

liquidev opened this issue Jan 29, 2023 · 1 comment

Comments

@liquidev
Copy link
Member

To ensure a predictable and consistent environment for all Mica scripters, I believe the ability to create globals should be reserved for the core library, and embedders should use modules (#74) instead. Following that, scripts should not set global variables, but rather return module tuples to pass things back to the embedding program.

@liquidev
Copy link
Member Author

liquidev commented Feb 4, 2023

One concern I have with this is that this'll make the REPL effectively useless, since local variables are not visible from one chunk to another. Then maybe the correct way would be to make global variables opt-in during script compilation, for REPL purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📦 Backlog
Development

No branches or pull requests

1 participant