ProtocolsImpl.Mesa
Last Edited by: Spreitzer, March 12, 1985 12:34:53 pm PST
DIRECTORY Atom, List, Protocols, Rope;
ProtocolsImpl: CEDAR PROGRAM
IMPORTS Atom, List, Rope
EXPORTS Protocols
= {OPEN Protocols;
protocols: List.AList ← NIL;
GetProtocol: PUBLIC PROC [name: ROPE] RETURNS [p: Protocol] = {
a: ATOM ← Atom.MakeAtom[name];
p ← NARROW[List.Assoc[key: a, aList: protocols]];
IF NOT name.Equal[p.name] THEN ERROR;
};
RegProtocol: PUBLIC PROC [p: Protocol] = {
a: ATOM ← Atom.MakeAtom[p.name];
protocols ← List.PutAssoc[key: a, val: p, aList: protocols];
};
}.