Lambda Conversion
Function application is lambda conversion
- ((lambda (n) (+ n 1)) 10)
11
Converting the lambda expression means:
- replacing variables by the values of arguments in the body of the lambda expression, (+ n 1) becomes (+ 10 1)
- evaluating the body in the context of these variable bindings and returning the result
(define increment (lambda (n) (+ n 1))) allows us to write