title: Racket macro to define functions given a repeated pattern
body: <p>The problem is quite difficult to explain because I need to collect my thoughts, so bear with me. I've been able to reduce the problem to a minimal example for illustrative purposes. The example will not make any sense as to what this would be useful for, but I digress. Say I want to extend the racket language to write things that look like this:</p>
  
  <pre><code>(define-something
    (['a] 'whatever)
    (['b 'c] 'whatever2))
  </code></pre>
  
  <p>Between the square brackets is a sequence of one or more symbols, followed by a sequence of racket expressions (the <code>whatever</code>'s, which are not important for the problem statement)</p>
  
  <p>The example would match a macro that looks something like this:</p>
  
  <pre><code>(define-syntax (define-something stx)
    (syntax-case stx ()
      [(_  ([symb ...] body ...) ...)
       #'()]))
  </code></pre>
  
  <p>Actually here we match 0 or more symbols, but we can assume there is always going to be at least one. </p>
  
  <p>In the macro's body I want to generate function definitions using the concatenated symbols as the identifier. So for our silly example the macro would expand to something like:</p>
  
  <pre><code>(define (a) 'whatever)
  (define (bc) 'whatever2)
  </code></pre>
  
  <p>I have found a <a href="https://stackoverflow.com/questions/16575085/racket-macro-to-auto-define-functions-given-a-list">similar question</a> where the poster generates functions using a pre-defined list of strings, but I am not that fluent with macro's so I have not been able to translate the concepts to solve my problem. I thought perhaps I could try generating a similar list (by concatenating the symbols) and applying their tactic, but I've been getting way too confused with all the ellipses in my macro definition. I'm also a bit confused about their use of an ellipsis in <code>with-syntax</code>.</p>