Re: [racket-users] syntax-parse ellipsis question

2019-09-21 Thread Jonathan Simpson
Thanks. I'm currently running 6.12, so this may be what convinces me to go ahead and upgrade. -- Jonathan On Sat, Sep 21, 2019 at 4:28 PM Philip McGrath wrote: > Use `~@` (sine Racket 7.0): > (syntax-parse #'(1 2 2 a 2 2 b 2 c) > [(1 (~seq n:nat ...+ x) ...) >#'((~@ n ... x) ...)]) > >

Re: [racket-users] syntax-parse ellipsis question

2019-09-21 Thread Ryan Culpepper
On 9/21/19 10:15 PM, Jonathan Simpson wrote: Given this macro that I'm experimenting with: (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+ x) ...) #'((n ... x) ...)]) How would I change it so that it returns #'(2 2 a 2 2 b 2 c) instead of #'((2 2 a) (2 2 b) (2 c)) ? I don't want

Re: [racket-users] syntax-parse ellipsis question

2019-09-21 Thread Jens Axel Søgaard
Den lør. 21. sep. 2019 kl. 22.15 skrev Jonathan Simpson : > Given this macro that I'm experimenting with: > > (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+ x) ...) #'((n ... > x) ...)]) > > How would I change it so that it returns #'(2 2 a 2 2 b 2 c) instead of > #'((2 2 a) (2 2 b) (2

Re: [racket-users] syntax-parse ellipsis question

2019-09-21 Thread Philip McGrath
Use `~@` (sine Racket 7.0): (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+ x) ...) #'((~@ n ... x) ...)]) -Philip On Sat, Sep 21, 2019 at 4:15 PM Jonathan Simpson wrote: > Given this macro that I'm experimenting with: > > (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+

[racket-users] syntax-parse ellipsis question

2019-09-21 Thread Jonathan Simpson
Given this macro that I'm experimenting with: (syntax-parse #'(1 2 2 a 2 2 b 2 c) [(1 (~seq n:nat ...+ x) ...) #'((n ... x) ...)]) How would I change it so that it returns #'(2 2 a 2 2 b 2 c) instead of #'((2 2 a) (2 2 b) (2 c)) ? I don't want the parens around the individual sequences that