Lazy Evaluation and Copy Rule
- Two styles of function evaluations.
- Lazy (call by name).
- Eager (call by value).
- Lazy evaluation for abstractions is norm.
- Body not computed until invocation.
- fun F = @loc1+1
loc1:=0; loc1:=F; loc2:=F+2.
- @loc+1 is computed each time F is invoked.
- Lazy evaluation supports copy rule.
- ...fun I=E ...in ...I ...
= ......in ...E ...
- Body of I is copied into places of invocation.
- loc1:=0; loc1:=@loc1+1;
Copy rule suits our intuition of abstractions as abbreviations!
Author: Wolfgang Schreiner
Last Modification: April 2, 1998