[racket] a syntax-case question
On 09/27/2011 08:15 PM, Jon Stenerson wrote:
>
> I'm trying to understand what this is supposed to do:
>
> (define (parse stx)
> (syntax-case stx ()
> [(_ p ...) #'(p ...)]))
>
> (display (parse #'(1 2 3)))
>
> If I run this in DrRacket with first line #lang racket
> I get a syntax object containing a list: #<syntax:7:17 (2 3)>
>
> If I run with #!r6rs instead I get a list of syntax objects:
> { #<syntax:9:21 2> #<syntax:9:23 3> }
>
>
> Is this a legitimate difference between two languages? Or is one of them
> right and the other wrong?
Both languages are behaving according to their specifications, so I
suppose you could call that a legitimate difference. I think the Racket
rules about representing syntax are superior to the R6RS rules, though,
so Racket is right and R6RS is somewhat less right.
Ryan