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

Add variable capture to lisp nodes #42

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

eliaslfox
Copy link
Collaborator

Previously lisp nodes were rewritten with a code walker to allow them to
access renamed variables. This seemed to fragile so lisp nodes now must
declare which local variables they wish to use. The lisp node's form
will then be wrapped in a let block during codegen which will unrename
the requested variables.

Fixes #5

@eliaslfox eliaslfox enabled auto-merge (rebase) August 31, 2021 19:51
Copy link
Member

@colescott colescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faux-macros.lisp needs to be updated to reflect the new argument. Otherwise looks great!

@eliaslfox eliaslfox force-pushed the feature-lisp-form-variable-capture branch 2 times, most recently from 1cfdff4 to 18327d0 Compare August 31, 2021 21:36
@eliaslfox eliaslfox force-pushed the feature-lisp-form-variable-capture branch from 18327d0 to ac7d849 Compare August 31, 2021 21:41
Previously lisp nodes were rewritten with a code walker to allow them to
access renamed variables. This seemed to fragile so lisp nodes now must
declare which local variables they wish to use. The lisp node's form
will then be wrapped in a let block during codegen which will unrename
the requested variables.

Fixes #5
@eliaslfox eliaslfox force-pushed the feature-lisp-form-variable-capture branch from ac7d849 to e058ee6 Compare August 31, 2021 21:46
@eliaslfox eliaslfox merged commit 8831556 into main Aug 31, 2021
@eliaslfox eliaslfox deleted the feature-lisp-form-variable-capture branch September 1, 2021 16:37
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

Successfully merging this pull request may close these issues.

LISP forms don't properly rewrite variables
2 participants