GenSymImpl.Mesa
last edited by Spreitzer January 10, 1984 4:44 pm
DIRECTORY Atom, GenSym, IO;
GenSymImpl: CEDAR PROGRAM
IMPORTS Atom, IO
EXPORTS GenSym =
BEGIN
count: REF INTNIL;
Gen: PUBLIC PROC [prefix: CHARACTER ← 'A] RETURNS [a: ATOM] =
{a ← Atom.MakeAtom[IO.PutFR["%g%g", IO.char[prefix], IO.int[count^ ← count^+1]]]};
Start: PROC =
BEGIN
a: ATOM ← Atom.MakeAtom["Spreitzer February 1, 1984 9:07:34 pm PST"];
count ← NARROW[Atom.GetProp[atom: a, prop: $GensymCount]];
IF count = NIL THEN Atom.PutProp[atom: a, prop: $GensymCount, val: count ← NEW [INT ← 0]];
END;
Start[];
END.