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
:
Delta
class
->
{A:
Delta
,
SAVE
:
Delta
->
comm
}
dec
import
M
(
newint
) instantiates
Delta
by
intloc
import
M
(
newint
):
{A:
intloc
,
SAVE
:
intloc
->
comm
}
dec
Parametric Polymorphism.
Author:
Wolfgang Schreiner
Last Modification: May 7, 1998