title: Implenting simultaneous bindings
body: <p>I'm writing a Lisp (code at <a href="https://github.com/chris-taylor/Haskeme" rel="nofollow">GitHub</a>) and I want to implement local bindings. Currently I have two syntaxes:</p>
  
  <pre><code>(let &lt;var&gt; &lt;val&gt; &lt;expr&gt;)
  </code></pre>
  
  <p>for binding a single variable or function, and</p>
  
  <pre><code>(with (&lt;var1&gt; &lt;val1&gt; ... &lt;varN&gt; &lt;valN&gt;) &lt;expr&gt;)
  </code></pre>
  
  <p>to bind multiple values at once.</p>
  
  <p>At present, the bindings are evaluated sequentially, and each new function binding retains a copy of the environment it was defined in, so <code>&lt;var2&gt;</code> can refer to <code>&lt;var1&gt;</code> but not vice-versa.</p>
  
  <p>I would like to modify the code so that when binding multiple values at once you effectively have simultaneous binding. For example, I would like to be able to write (this is a trivial example, but it should illustrate the idea):</p>
  
  <pre><code>(define (h y)
    (with ((f x) (if (eq? x 0) #t (g (- x 1)))
           (g x) (if (eq? x 0) #f (f (- x 1))))
    (f y))
  </code></pre>
  
  <p>At the moment this code doesn't run - <code>g</code> closes over <code>f</code>, but not the other way around.</p>
  
  <p>Is there a canonical way to implement simultaneous binding in Lisp?</p>