Evaluation Strategy
Crucial issue of parameters
- Call-by-value
- Evaluate actual parameter immediately at point of invocation (eager
evaluation).
- Call-by-name
- Delay evaluation of actual parameter until the point of its use in the
body of the abstraction (lazy evaluation).
- Example:
- var A: newint
proc P(M: intexp) = A:=M;
A:=M
in call P(@A+1)
- Eager evaluation yields A=2.
- Lazy evaluation yields A=3!
Author: Wolfgang Schreiner
Last Modification: May 7, 1998