title: Racket and unbound identifier in lambda expression, contrast with r5rs
body: <p>In DrRacket, when I set the language to R5RS and run the following code:</p>
  
  <pre><code>(lambda (x) z)
  </code></pre>
  
  <p>it runs without error and returns <code>#&lt;procedure&gt;</code>. This makes sense to me; the lambda form defines a procedure whose body has not yet been evaluated, and so that procedure is returned.</p>
  
  <p>Alternatively, when I use the Racket language dialect, I get the following error:</p>
  
  <pre><code>z: unbound identifier in module in: z
  </code></pre>
  
  <p>I don't understand why Racket is producing this error. I mean, of course I see that <code>z</code> is undefined, but my understanding of the evaluation model is that the body of the function is not evaluated at the time of the function definition. That's consistent with the R5RS result, but not with the Racket result. What is Racket doing here, precisely? Is it "peeking" in some way in the body of the code to see if the variables are defined? What is different in the evaluation model from R5RS that results in this different behavior?</p>