[plt-scheme] combining ... and . in syntax-case patterns
I think you probably have to write it a little more explicitly,
perhaps in a loop:
([v t] . rest) ;; pattern for collect & recur
(x . rest) ;; pattern for all done
But it seems like syntax-case should signal a syntax error for
patterns like that (altho perhaps there is some interesting reason why
that's tricky?)
Robby
On Jan 19, 2008 1:48 PM, Sam TH <samth at ccs.neu.edu> wrote:
> I would like to write the following syntax-case pattern:
>
> (syntax-case x ()
> [([v t] ... . more)
> #'(v ...)]
> [_ (error)])
>
> That is, any number of [v t] forms, followed by anything else.
>
> Unfortunately, this pattern never matches any syntax objects. Is
> there a better way to write this pattern, or do I need to resort to
> explicitly destructuring the syntax object?
>
> Thanks,
> --
> sam th
> samth at ccs.neu.edu
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>