Go backward to Modules Go up to Top Go forward to Orthagonality |
SIMULA, C++.
class STACK-OF-(X) =
record
begin
var ST: array [1..k] of nat;
var TOP: nat
within
proc PUSH(l: nat) = ...
proc POP = ...
fcn TOP = ...
proc INITIALIZE = ...
end
end
var A: STACK-OF(nat)
Classes are record type abstracts that enclose declaration blocks.
(Storage is allocated when class variable is defined.)