chickadee » procedural-macros » macro-rules

(macro-rules sym ... (key ...) (pat tpl) ....)syntax

like syntax-rules, but the templates are usually quasiquote-expressions. Moreover, the symbols sym ... are injected, if there are any.

Note, that non-symbol literals are accepted in each pat and considered a match if they are equal to the corresponding expression in the macro-code. The keys are transformed to keyword literals behind the scene.

macro-rules must be imported for syntax if used in the preprocessing phase of a macro evaluation.