title: Capturing a variable number of arguments via an ellipsis in a nested macro; Missing pattern variable error
body: <p>Consider a scenario of two macros: the <code>outer-macro</code> defines a general structure of some entity, and the <code>inner-macro</code> expands in the scope of the outer macro. My intent is captured in the following code, where the expected output is a print statement. This example throws the following error for the pattern of the inner macro: <code>(_ value ...)</code>.</p>
  
  <pre><code>syntax: no pattern variables before ellipsis in template in: ...
  </code></pre>
  
  <p>I intend to use <code>value ...</code> in the same way as the <code>body ...</code> pattern of the outer macro. In fact, a list of the 'values' is exactly what I need (not necessarily a very flexible 'ellipsis pattern'). Sadly it does not work this way. How can I capture a variable amount of arguments in the inner macro? </p>
  
  <pre><code>#lang racket
  
  (require
    racket/stxparam
    (for-syntax syntax/parse))
  
  (define-syntax-parameter inner-macro
    (lambda (stx)
      (raise-syntax-error 'inner-macro "generic error message" stx)))
  
  (define-syntax (outter-macro stx)
    (syntax-parse stx
      [(_ body:expr ...+)
       #'(syntax-parameterize
          ([inner-macro
            (lambda (stx)
              (syntax-case stx ()
                [(_ value ...)
                 (printf "values are: ~a~n" (list value ...))]))])
          body ...)]))
  
  (outter-macro
   (inner-macro 'a 'b 'c))
  
  ; expected result
  ; &gt; "values are: (a b c)"
  </code></pre>