rhombus-prototype
rhombus-prototype copied to clipboard
Not all macro options are allowed in pre-alts block position
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.
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.