Go backward to Parameter Substitution
Go up to Top
Go forward to Declaration and Variable Parameters
Numeral and Command Parameters
- Example:
- const K=2; var A; newint;
proc P(M: comm) = A:=K+1; M;
proc Q(X: int) = A:=X
in call P(call Q(2));
call P(call P(call Q(K)));
call P(A:=K)
- Command parameters evaluated lazily.
- Eagerly evaluated command parameters:
- Argument defines backtracking point.
- [[pi |-call I(C): comm
= ([[pi |- C: comm]] )
where (I=) in
- var A; newint;
proc P(M: comm) =
...if error
then M else ...fi
in ...call P(A:=0)
- Reference of M extracts old store!
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: parameter.tex,v 1.1 1996/04/25 11:40:48 schreine Exp schreine