title: How to define a macro with an indefinite amount of arguments inside another macro?
body: <p>This works, but <code>test_macro</code> accepts only one argument:</p>
  
  <pre><code>macro_rules! test_define (
      ($name:ident) =&gt; (
          macro_rules! $name (
              ( $x:expr ) =&gt; (
                  // something
              )
          );
      )
  );
  
  test_define!(test_macro);
  </code></pre>
  
  <p>If I try and do this:</p>
  
  <pre><code>macro_rules! test_define2 (
      ($name:ident) =&gt; (
          macro_rules! $name (
              ( $($x:expr),* ) =&gt; (
                  // something
              )
          );
      )
  );
  
  test_define2!(test_macro2);
  </code></pre>
  
  <p>Compilation fails with:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
   --&gt; src/main.rs:4:16
    |
  4 |             ( $($x:expr),* ) =&gt; (
    |                ^^^^^^^^^
  </code></pre>