Make define-macro macro that outputs JS functions#102
Open
Conversation
|
That could actually make macro debug much easier too, right ? |
Collaborator
Author
I'm not sure it will be make a big difference since most of the time compilation will happen ahead of time, although it may make testing of macros little easier. |
Collaborator
Author
|
Namespace fixes mentioned earlier have being worked on under #103 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is work in progress patch. With this extension following code will produce output below it:
Only visible difference is that macro will actually compile to a JS function. This is a step towards implementing macro imports. Now what's left is to extend analyzer (or maybe compiler) so that
:requireforms fromnswill actually be required during compilation. That way macros from those modules will actually be installed. In addition macro expander will have to be modified slightly so that it will look up macros not only in it's own hash map but rather wheredefine-macroinstalls them:this['user.wisp$unless']. Finally namespace info will have to be preserved on symbols so that in the code(unless weekend? (alarm "8:00"))unlesscould be mapped back to either localunlessor imported one likemy.macros/unlesswhich is necessary to properly resolve macros.