- GENERIC DEFINITION MODULE GTwice (T : TYPE);
- (* One generic instantiated twice with different scalar families. The
- forward pointer base (NodeRec declared after Node) used to make the
- second instance resolve the first instance's record. *)
- TYPE
- Node = POINTER TO NodeRec;
- NodeRec = RECORD val : T; next : Node END;
- Stack = RECORD top : Node; depth : INTEGER END;
- PROCEDURE Init (VAR s : Stack);
- PROCEDURE Push (VAR s : Stack; v : T);
- PROCEDURE Pop (VAR s : Stack; VAR v : T) : BOOLEAN;
- END GTwice.
|