November 2017
Intermediate to advanced
670 pages
17h 35m
English
This is what happens when we evaluate a lambda expression:

Let's describe our visualization.
First, we define our function as the abstract operation of a + b. This operation requires two values, a and b. Second, when we execute add2 := add(2) , we are binding the value 2 to the variable a. (a is technically a variable, but we treat it like a constant. Remember? Functional programming does not permit mutation.) Since our inner, anonymous function closes over a, the a variable's value is stored in the context of our closure structure and remains available for use later when we apply b and finally evaluate our ...