Content deleted Content added
m avoid unnec redirect |
m →Scheme: Added reference title Tags: Mobile edit Mobile app edit Android app edit App section source |
||
(One intermediate revision by the same user not shown) | |||
Line 95:
}
</syntaxhighlight>
== Scheme ==
The <code>syntax-rules</code> hygienic macro system originally introduced in [[Scheme (programming language)|R4RS]] uses <code>...</code> to specify that the proceeding pattern may be matched zero or more times. For example, the following code could be used to implement the standard <code>let*</code> form, recursively in terms of itself, and the more primitive <code>let</code>:
<syntaxhighlight lang="scheme">
(define-syntax let*
(syntax-rules ()
((let* () body1 body2 ...)
(let () body1 body2 ...))
((let* ((name1 val1) (name2 val2) ...) body1 body2 ...)
(let ((name1 val1))
(let* ((name2 val2) ...) body1 body2 ...)))))
</syntaxhighlight>
SRFI 46<ref>{{Cite web |url=https://srfi.schemers.org/srfi-46/srfi-46.html |title=SRFI 46}}</ref> was proposed to extend <code>syntax-rules</code> to allow the user to specify an ellipsis identifier. This is useful for disambiguating when ellipsis are use in nested macro definitions. This feature was later included in R7RS.
== Multiple dimensions ==
|