-
Notifications
You must be signed in to change notification settings - Fork 11
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
hide caller env from callee #263
Conversation
in a lambda, only the variables which are lexically visible at the definition site are visible, not the variables which are lexically visible at the call site. therefore, when invoking a closure, we should evaluate the body in the captured environment, not in a combined environment containing both the captured environment and the call site's environment.
since the caller's environment is immediately replace by the closure's environment, there is no difference between 'apply' and 'applyInEnv'.
now that the caller's variables are no longer included in the environment, this exposed a bug where the evaluator recurred with the upward-propagated environment rather than the environment which was captured in the Kont. actually, it never makes sense to be propagating the callee's environment to the caller, so all the other uses of that environment must also be bugs. let's not propagate this environment at all.
WalkthroughThis pull request updates the evaluator and macro expander modules. In the evaluator, the upward evaluation state and error reporting have been simplified by removing the environment parameter from the Changes
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (6)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a few places to silence warnings. I had made these changes in the stack traces branch but didn't go as far as removing the env
from Up
. Great Work!
I have made all the requested changes. merging! |
in a lambda, only the variables which are lexically visible at the definition site are visible, not the variables which are lexically visible at the call site. therefore, when invoking a closure, we should evaluate the body in the captured environment, not in a combined environment containing both the captured environment and the call site's environment.
also,
Up
was propagating the callee's environment to the caller, and it was sometimes accidentally used instead of the environment captured inKont
.Summary by CodeRabbit
These improvements enhance the maintainability and consistency of the system while ensuring smoother internal processing without altering the outward functionality.