[racket] syntax-case and multiple ellipsis

From: Stephen Chang (stchang at ccs.neu.edu)
Date: Tue Jun 17 14:02:32 EDT 2014

syntax-case won't let you do that, but syntax-parse will:

(syntax-parse #'(test A (def 1 2 3) (in 4 5 6)) #:datum-literals (in def)
  [(_ name
      (def a ...) ...
      (in clause do ...) ...)
   #'(a ... ... do ... ...)])

On Tue, Jun 17, 2014 at 1:46 PM, Spencer Florence
<florence at northwestern.edu> wrote:
> 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
>

Posted on the users mailing list.