[racket] syntax-case and multiple ellipsis

From: Spencer Florence (spencer at florence.io)
Date: Tue Jun 17 14:08:11 EDT 2014

Unfortunately I'm working in typed racket, which (as far as I can tell)
doesn't play nice with syntax-parse. Any other ideas?


On Tue, Jun 17, 2014 at 1:04 PM, Jens Axel Søgaard <jensaxel at soegaard.net>
wrote:

> Hi Spencer,
>
> The problem is that syntax-case pattern doesn't allow allow
> pattern of the form (x ... y ...) that is with two ellipsis on the
> same level.
>
> Luckily syntax-parse allow these:
>
> (require syntax/parse)
>
> (syntax-parse #'(a a a a 41 42 43)
>   [(c ... d ...)
>    #''((c ...) (d ...))])
>
> (syntax-parse #'(a a a a 41 42 43)
>   [(c:id ... d ...)
>    #''((c ...) (d ...))])
>
>
> /Jens Axel
>
>
>
>
> 2014-06-17 19:46 GMT+02:00 Spencer Florence <florence at northwestern.edu>:
> > Hey all,
> >
> > I'm trying to write a macro with syntax-case that looks something like
> this:
> >
> >  (syntax-case stx (in def)
> >     [(_ name
> >         (def a ...) ...
> >         (in clause do ...) ...)
> >      stuff])
> >
> > But, this gives me the error "syntax-case: misplaced ellipsis in pattern
> > (follows other ellipsis)" on the last ellipsis. Does anyone know a way
> > around this?
> >
> > --spencer
> >
> > ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
> >
>
>
>
> --
> --
> Jens Axel Søgaard
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140617/1816ccfd/attachment.html>

Posted on the users mailing list.