-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2cbee0
commit 605bc65
Showing
3 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
605bc65
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.
Exciting! (Probably only to me though.)
605bc65
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.
Yes, this is going to be ready real soon. My biggest concern is what to call
syntax_escape
. It will be used likequote $syntax_escape(var)(x) end
but that is really too verbose. We could pick a short name likeesc
or even a single letter, and arrange it to be a local function within macro definitions to avoid polluting the global namespace.605bc65
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.
I like
esc
but I worry about having it local to macro definitions since it's pretty standard to define the macro transformation as a function for debugging purposes and then call that function from the macro. Some need to do that could be alleviated by providing a way to call macro transformers directly, but there are still cases where one wants a separate function, e.g. when there are additional arguments that modify the way the code is generated (e.g. _jl_interp_parse). Of course, that's relatively rare, so maybe it's ok to have to explicitly import/prefixesc
in those cases. A sensible way to do this might be to have aMacro
module that provides macro-related tools likeesc
and just have that be automatically imported in the body of macros. Speaking of which, can one import into any scope or only top-level? Importing into a function body seems like a useful thing to be able to do.605bc65
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.
Oh, while you're at it, can I make a plea for changing macro functions to being generic. This would make me much happier.