[racket] pass pattern vars as syntax-class args before they appear in syntax-parse pattern
I want to do something like this:
#lang racket
(require syntax/parse)
(define-syntax-class (myclass . args)
(pattern x:id))
(syntax-parse #'(a (b c))
[((~var x (myclass #'(y ...))) ...
(y z) ...)
#'(x ...)])
But this doesnt work because I'm trying to pass y before it is bound.
Is there an elegant way to do this, while still preserving my
syntax-class abstraction? If I leave x undeclared initially and then
use #:declare, then x ... will match everything, which I dont want.
I'm almost certainly missing something obvious but I can't figure it out.