The outermost frame holds the global variables. Closure formation New closures are created by evaluating lambda ex- pressions. The environment portion of the closure is just the current environment, which defines all the free variables. Any smaller environment that defined the free vari- ables would also be ok to use in the closure, but rho is already handy. To build this environment at function application time, the interpreter extends the environment stored in the closure with a new frame containing bindings for the formal parameters.
Folds Consider the following problems.
So it's not bad style to define all functions as curried. Equivalently, we could insist that every function take exactly one argument. Most of the code we've written for container data structures, like dictionaries or sets, will work regard- less of what type of data is stored in these structures. We describe this as generic code. But we often need to parameterize these structures by one or more appropriate operators.