Let’s review Procs for a bit. Procs are just functions that can be treated as data, what functional programming languages call first-class functions. Functions can create Procs; we saw that both
return_proc return Procs of different sorts. Given all that, what prevents us from making a Proc that returns another Proc when called? Nothing at all.
make_exp example below, we create specific versions of Procs that raise an argument to some specified power. That power is the
exp argument taken by the outer
lambda, which is described as a free variable because it is not an explicit argument to the inner
lambda, which is returned, has a bound variable called
x. It is bound because it is an ...