4.10 Lazy Evaluation
TBoS p.137-141
Shen provides on-demand type secure lazy evaluation; the function 'freeze' creates an object b;
from its argument a without evaluating a. The function 'thaw' takes b and evaluates it to the normal form of a.
These functions satisfy the equation (thaw (freeze a)) = a.
(0-) (freeze (factorial 8))
FUNCTION :LAMBDA NIL (factorial 8)
(1-) (thaw (freeze (factorial 8)))
40320 |
|