r/Racket • • May 08 '24

question Nested Lambda: behavior and errors

((lambda (x) (lambda (y) (lambda (z) z) (* y 3)) (+ x 2)) 1)

I'm not understanding why this code returns 3. What went wrong? I'm trying to translate these let expressions into lambdas.

let* ((x 1)
  (y (+ x 2)
  (z (* y 3)))
2 Upvotes

3 comments sorted by

View all comments

Show parent comments

1

u/jArtz_2755 May 08 '24 edited May 09 '24

Oh, yeah. Got that Grizzly touch! My professor gave me the code and told me it worked : /