Skip to content

Standard way to construct RewriteRules at run-time? #273

@THinnerichs

Description

@THinnerichs

Hey,

I really like the Julia macro solution for constructing rules with @rule in Metatheory. Now, I would like to construct RewriteRules at run-time.

However, the expanded macro (Base.remove_linenums! for better readability)

 Base.remove_linenums!(@macroexpand @rule :a --> 1)

is pretty verbose.

What would be the standard way to construct a RewriteRule at run-time, then? Preferably, I would like to have something like

a = :a
b =1
r = RewriteRule(a, -->, b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions