The description of macro transformers in section 11.19 states:

   Each <syntax rule> must have the following form:

   (<srpattern> <template>)

   An <srpattern> is a restricted form of <pattern>,
   namely, a nonempty <pattern> in one of four
   parenthesized forms below whose first subform
   is an identifier or an underscore _.

The restriction is sensible for a language such as R5RS in which
transformers can be applied only to syntax representing a macro
instance (a non-empty parenthesized form, whose first subform is a
syntactic keyword).  This is no longer true in the current draft of
R6RS since one can write:

   (import (rnrs))
   ((syntax-rules ---) ---)

Restricting the domain of procedures created with syntax-rules is
artificial and needless.  The restriction should be dropped and
<srpattern> should be replaced simply with <pattern>.  It's a trivial
simplification to the syntax-case definition of syntax-rules given in
12.8 (libraries).  Dropping the restriction allows the following
examples to work as expected:

   (import (rnrs))
   (syntax-rules () (x x))   ;; identity function on syntax.
   ((syntax-rules ()
      (#t 'true)
      (#f 'false))
    (syntax #t))    ;; => 'true

David

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

Reply via email to