[plt-scheme] define-syntax question

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Aug 1 19:43:06 EDT 2002

> I'm doing a little work in version 103 with define-syntax and I'm having a
> little trouble.  Here's my example and the results.
> [...]
> (define-syntax d2
>   (syntax-rules ()
>                 ((_ (fun arg1 ...) pgm ...)
>                  'multi-args)
>                 ((_ (fun arg1 . rest) pgm ...)
>                  'improper-list)
>    ))
> [...]
> > (d2 (x a . b) a)
>  andmap: expects type <proper list> as 2nd argument, given: (a . b); other
> arguments were: #<procedure>

This looks to me like a bug in 103's `syntax-rules'.

In my copy of plt/collects/mzlib/synruler.ss, replacing `pair?' with
`list?' on line 278 seems to fix the problem.

Matthew




Posted on the users mailing list.