Go backward to Type-Structure Parameters
Go up to Top
Go forward to Denotational Semantics
Generalization
- Parameters with unknown type attributes (Ada)
- module M(T: Type-structure)
={var A:T; proc SAVE(X:T)
= A:=@X}
...import M(newint) ...in call
SAVE(A)
- All uses of T in M independent of actual value of T.
- Typing rules:
- M: Deltaclass {A:Delta,
SAVE:Delta comm}dec
- import M(newint) instantiates Delta by
intloc
- import M(newint):
{A:intloc, SAVE:intloc comm}dec
Parametric Polymorphism.
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: parameter.tex,v 1.1 1996/04/25 11:40:48 schreine Exp schreine