In DrRacket, when I install the language in R5RS and run the following code:
(lambda (x) z)
It works without errors and returns #<procedure>. It makes sense to me; the lambda shape defines a procedure whose body has not yet been evaluated, and therefore the procedure returns.
Alternatively, when I use the Racket language dialect, I get the following error:
z: unbound identifier in module in: z
I do not understand why Racket produces this error. I mean, of course, I see that it is zundefined, but my understanding of the evaluation model is that the body of the function is not evaluated during the definition of the function. This is consistent with the result of R5RS, but not with the result of Racket. What is racket here, exactly? Is it "peeking" somehow in the body of the code to determine if variables are defined? What is the difference between the assessment model and R5RS, which leads to this other behavior?
source
share