Go backward to Soundness Theorem
Go up to Top
Go forward to Declaration Unions
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.
- Example:
- fun F = @loc_1+1
in
loc_1:=0; loc_1:=F; loc_2:=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.
- loc_1:=0; loc_1:=@loc_1+1;
loc_2:=(@loc_1+1)+2.
Copy rule suits our intuition of abstractions as abbreviations!
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: abstraction.tex,v 1.1 1996/03/05 08:55:21 schreine Exp schreine