(rontolisp) docs
← Syntax

syntax-rules

(syntax-rules (literal...) (pattern template)...) (syntax-rules ellipsis (literal...) (pattern template)...)

The transformer of a syntax definition. A use is matched against each pattern in turn (its first element, the keyword, is ignored), and the first that matches has its template instantiated with what the pattern variables matched. In a pattern, a literal matches only the same binding, _ matches anything, and ... (or the given ellipsis) repeats the subpattern before it -- nested, followed by more patterns, in a dotted tail or in a vector. In a template, ... repeats the subtemplate before it and (... ...) stands for a literal .... A use no rule matches is an error when the file is read.