[plt-scheme] Macro ellipsis question

From: James Coglan (jcoglan at googlemail.com)
Date: Tue Jan 27 09:25:13 EST 2009

> > (define-syntax parallel-set!
> >   (syntax-rules ()
> >     [(parallel-set! (symbol ...) (value ...))
> >       (set! symbol value) ...]))
> >
> > (parallel-set! (a b c) (1 2 3))
> > ; a = 1, b = 2, c = 3
>
> Only one form is allowed in the template portion of `syntax-rules',
> but you have two: (set! symbol value) and ... .
>
> You probably want
>
> (begin (set! symbol value) ...)



Could someone second this? I thought I saw multi-statement templates in some
examples though I can't remember where. R5RS would seem to agree with Sam
but I'd like to be sure. Also, my main question was whether this macro would
actually expand in the way I expect. The mzscheme repl seems to confirm all
the above but if someone knows anything about other rules in other Schemes
I'd like to know.

Thanks Sam,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090127/b2d9c852/attachment.html>

Posted on the users mailing list.