ellipsis & dot in `syntax-case` pattern

Matthew Butterick <[email protected]>
Newsgroups gmane.comp.lang.racket.user,gmane.lisp.scheme.plt
Message-ID <[email protected]>
According to the syntax-pattern grammar in the docs for `syntax-case` [1] it should be possible to use an ellipsis and a dot in the same syntax pattern. Yet this pattern fails to match the input. Why?

#lang racket
(syntax-case #'(a "x" b) ()
  [(left ... "x" . right) #t]
  [else #f]) ; #f

(I know that `syntax-parse` will handle it correctly, but I'm still curious what I'm missing about the behavior of `syntax-case`.)

#lang racket
(require syntax/parse)
(syntax-parse #'(a "x" b)
  [(left ... "x" . right) #t]
  [else #f]) ; #t


[1] https://docs.racket-lang.org/reference/stx-patterns.html?q=syntax-case#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29 <https://docs.racket-lang.org/reference/stx-patterns.html?q=syntax-case#(form._((lib._racket/private/stxcase-scheme..rkt)._syntax-case))>

-- 
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.