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

Not all macro options are allowed in pre-alts block position #464

Open
usaoc opened this issue Jan 12, 2024 · 1 comment
Open

Not all macro options are allowed in pre-alts block position #464

usaoc opened this issue Jan 12, 2024 · 1 comment

Comments

@usaoc
Copy link
Collaborator

usaoc commented Jan 12, 2024

Example:

#lang rhombus/and_meta
expr.macro self_quote:
  ~op_stx self
| 'self_quote':
    '#%literal $(self.to_source_string())'

Options like op_stx, all_stx, etc., seem to be allowed only in the “right-hand side” position.

@mflatt
Copy link
Member

mflatt commented Jun 18, 2024

This was an intentional choice in the implementation, although I see that it's not documented right. The rationale behind the current choice is that options like ~op_stx and ~all_stx bind names that are only visible after he pattern, and it's weird to have a declaration of a name that is bound separately in multiple nested forms. So, I'm currently inclined to improve the documentation, but I don't think the choice is obvious.

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

No branches or pull requests

2 participants