[plt-scheme] Macro ellipsis question
Second. But Sam is a smart guy and your reading of the documents backs
him up, so it seems good to go with that over some vague memory you
have that you can't even substantiate.
On Tue, Jan 27, 2009 at 8:25 AM, James Coglan <jcoglan at googlemail.com> wrote:
>
>> > (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
>
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>