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 local-macros and extend hy.eval and hy.macroexpand #2525

Merged
merged 5 commits into from
Nov 6, 2023

Conversation

Kodiologist
Copy link
Member

@Kodiologist Kodiologist commented Nov 3, 2023

Now the user can list local macros and get local-macro objects. I've decided it's best not to try to implement adding or deleting local macros dynamically, since that seems messy and of dubious value. So the situation is similar to ordinary variables in Python: the global set is completely dynamic, while the local set is fixed at runtime.

[Edit: the following turned out to be easy enough, so I just added it to this PR.] Next up is allowing hy.eval to use local macros, perhaps as part of a general faculty to allow the user to pass in a dictionary of macros. Next, perhaps, some extensions to hy.macroexpand and hy.macroexpand-1 to control what set of macros they use.

@Kodiologist Kodiologist force-pushed the local-macros-firstclass branch from f3c97b2 to 3d4f27d Compare November 3, 2023 17:03
@Kodiologist Kodiologist force-pushed the local-macros-firstclass branch from 3d4f27d to 235244c Compare November 4, 2023 15:19
@Kodiologist Kodiologist changed the title Add local-macros Add local-macros and extend hy.eval and hy.macroexpand Nov 4, 2023
@Kodiologist Kodiologist merged commit 58f6573 into hylang:master Nov 6, 2023
9 checks passed
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.

Support user introspection and modification of the currently defined macros
1 participant