Skip to content

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

Open

Description

@usaoc

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.

Activity

  1. mflatt commented on Jun 18, 2024

    @mflatt
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions