[r6rs-discuss] Typo in Libraries, Ch 12, Sec 8
David Van Horn
dvanhorn at cs.brandeis.edu
Tue Aug 21 02:56:57 EDT 2007
The description of the syntax-case library contains the following note:
Note: Any syntax-rules form can be expressed with syntax-case
by making the lambda expression and syntax expressions explicit,
and syntax-rules may be defined in terms of syntax-case as follows.
(define-syntax syntax-rules
(lambda (x)
(syntax-case x ()
[(_ (k ...) [(_ . p) f ... t] ...)
#'(lambda (x)
(syntax-case x (k ...)
[(_ . p) f ... #'t] ...))])))
A more robust implementation would verify that the literals <literal> ...
are all identifiers, that the first position of each pattern is an
identifier,
and that at most one fender is present in each clause.
But fenders in syntax-rules went away in revision 5.92, so this should read:
Note: Any syntax-rules form can be expressed with syntax-case
by making the lambda expression and syntax expressions explicit,
and syntax-rules may be defined in terms of syntax-case as follows.
(define-syntax syntax-rules
(lambda (x)
(syntax-case x ()
[(_ (k ...) [(_ . p) t] ...)
#'(lambda (x)
(syntax-case x (k ...)
[(_ . p) #'t] ...))])))
A more robust implementation would verify that the literals <literal> ...
are all identifiers and that the first position of each pattern is
an identifier.
David
More information about the r6rs-discuss
mailing list