[r6rs-discuss] Typo in Libraries, Ch 12, Sec 8

From: David Van Horn <dvanhorn>
Date: Tue, 21 Aug 2007 02:56:57 -0400

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
Received on Tue Aug 21 2007 - 02:56:57 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC