GENERIC INTERFACETableList (Key, Value, KeyValueTable);
WhereKey.T
andValue.T
are types that are not open array types andKey
contains
PROCEDURE Equal(k1, k2: Key.T): BOOLEAN;andKeyValueTable
is the instantiation of the generic interfaceTable
with the interfacesKey
andValue
.
Equal
must be an equivalence relation.
Equal
may be declared with a parameter mode of eitherVALUE
orREADONLY
, but notVAR
.
TableList.T
's may be more efficient thanTable.Defaults
's for small tables.
TYPE T <: KeyValueTable.T OBJECT METHODS init(): T; keyEqual(READONLY k1, k2: Key.T): BOOLEAN END; TYPE XX = Value.T;
this use of Value.T is just to prevent a warning message. sigh.
END TableList.