-
Notifications
You must be signed in to change notification settings - Fork 9
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
def syntax - towards a more advanced macro utility #32
Comments
I'm thinking |
I think literal keyword reservation could possibly be handled with a seperate macro, |
What about something that's similar to this: (def syntax-parser macro-name
kw-option ...
[pat
body ...]
...) With maybe an extra And also, by the way, is there a reason why you would want literals to be syntax parameters? Why not just normal macros that raise error messages (by default)? |
The reason we have the literals defined as syntax-parameters everywhere at the moment is that you need to be able to export them as part of the module, or else any form that uses them will fail syntax checking. That's why base.rkt is full of (define-syntax-parameter ...) for every last in, with, etc. If there's some other way to do it I dunno, that's what was suggested to me, and what I've stuck to. So the question is whether we want to magic that behind the scenes, or force them to be similarly declared separately like they are in Racket. |
Those could be regular macros instead of syntax parameters, and they would export as part of the module, and forms can use them. They don't have to be syntax-parameters, they could just use regular |
Cool. I guess only the ones actually redefined inside macros (like the carry/cry etc.) actually need to be parameters then? |
Yes |
Huh. Well, something to look at refactoring then, perhaps. |
4125eca implements In a future overhaul I may even ditch them altogether anyhow. |
It's undocumented yet, but |
At the moment, Heresy defines only the simple
def macro
form, which is little more than a rename of Racket's define-syntax-rule. Tho has meant that a lot of macro work on new features has necessitated fallbacks to Racket.I'm currently brainstorming an idea for another feature that will require a little more flexibility, and I would like to do it in as close to pure Heresy as I can.
I'm suggesting
def syntax
as a candidate name for importing define-syntax at least.The text was updated successfully, but these errors were encountered: