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

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to