<div dir="ltr">Unfortunately I'm working in typed racket, which (as far as I can tell) doesn't play nice with syntax-parse. Any other ideas?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 1:04 PM, Jens Axel Søgaard <span dir="ltr"><<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Spencer,<br>
<br>
The problem is that syntax-case pattern doesn't allow allow<br>
pattern of the form (x ... y ...) that is with two ellipsis on the<br>
same level.<br>
<br>
Luckily syntax-parse allow these:<br>
<br>
(require syntax/parse)<br>
<br>
(syntax-parse #'(a a a a 41 42 43)<br>
[(c ... d ...)<br>
#''((c ...) (d ...))])<br>
<br>
(syntax-parse #'(a a a a 41 42 43)<br>
[(c:id ... d ...)<br>
#''((c ...) (d ...))])<br>
<br>
<br>
/Jens Axel<br>
<br>
<br>
<br>
<br>
2014-06-17 19:46 GMT+02:00 Spencer Florence <<a href="mailto:florence@northwestern.edu">florence@northwestern.edu</a>>:<br>
<div class="HOEnZb"><div class="h5">> Hey all,<br>
><br>
> I'm trying to write a macro with syntax-case that looks something like this:<br>
><br>
> (syntax-case stx (in def)<br>
> [(_ name<br>
> (def a ...) ...<br>
> (in clause do ...) ...)<br>
> stuff])<br>
><br>
> But, this gives me the error "syntax-case: misplaced ellipsis in pattern<br>
> (follows other ellipsis)" on the last ellipsis. Does anyone know a way<br>
> around this?<br>
><br>
> --spencer<br>
><br>
</div></div><div class="im HOEnZb">> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<br>
<br>
<br>
</div><span class="HOEnZb"><font color="#888888">--<br>
--<br>
Jens Axel Søgaard<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>