[r6rs-discuss] Why can ... and _ not be literals?

AndrevanTonder andre at het.brown.edu
Mon Jun 25 04:40:17 EDT 2007


Let me point out that, if the r6rs draft did not forbid it, there would be
a very nice solution to using ellipses and underscores /both/ as literals 
/and/ as special patterns.  The solution would be

   (import (r6rs)
           (rename (r6rs) (... :::) (_ *)))

   (define-syntax foo
     (syntax-rules (::: *)
       ((_ * (x :::) ...) 'matches))))

   (foo _ (x ...) (y ...) (z ...))   ==> matches

However, unfortunately currently r6rs forbids this.

On Sun, 24 Jun 2007, David Van Horn wrote:

> I'm
> on the fence with the (incompatilbe) change to underscore to no longer be
> considered a pattern variable.

There is in fact a trivial solution to porting legacy macros
using underscore.  Simply put them in a library where you use

   (import (except (r6rs base) _))

Cheers
Andre



More information about the r6rs-discuss mailing list