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

Closures should not copy the whole environment #152

Open
julianhyde opened this issue Jun 3, 2022 · 0 comments
Open

Closures should not copy the whole environment #152

julianhyde opened this issue Jun 3, 2022 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

Closures currently copy the whole environment. (It's not quite as bad as it sounds, because an environment is a binding to a value plus a pointer to the parent environment.) But the expression in a closure does not require the entire environment, just a small number of variables that can be determined by analyzing the expression at compile time. Those variables should be converted into numbered 'slots', the slots are populated when the closure is created, and when the expression is evaluated, it should look to those slots for values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant