Make define-macro macro that outputs JS functions #102
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
:require
forms fromns
will 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-macro
installs 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"))
unless
could be mapped back to either localunless
or imported one likemy.macros/unless
which is necessary to properly resolve macros.