DIRECTORY Rope USING [ROPE, Text]; Atom: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Text: TYPE = Rope.Text; PropList: TYPE = LIST OF DottedPair; DottedPair: TYPE = REF DottedPairNode; DottedPairNode: TYPE = RECORD [key, val: REF ANY]; EmptyAtom: PROC RETURNS[ATOM]; MakeAtom: PROC [pName: ROPE] RETURNS [ATOM]; MakeAtomFromChar: PROC [char: CHAR] RETURNS [ATOM]; MakeAtomFromRefText: PROC [rt: REF READONLY TEXT] RETURNS [ATOM]; GetPName: PROC[atom: ATOM] RETURNS[pName: Text]; GetPropertyList: PROC [atom: ATOM] RETURNS [PropList]; -- gets entire property list GetProp: PROC [atom: ATOM, prop: REF ANY] RETURNS [REF ANY]; GetPropFromList: PROC [propList: PropList, prop: REF ANY] RETURNS [REF ANY]; PutProp: PROC [atom: ATOM, prop: REF ANY, val: REF ANY]; PutPropOnList: PROC [propList: PropList, prop: REF ANY, val: REF ANY] RETURNS [PropList]; RemProp: PROC [atom: ATOM, prop: REF ANY]; RemPropFromList: PROC [propList: PropList, prop: REF ANY] RETURNS [PropList]; MapAtoms: PROC[proc: PROC[atom: ATOM]]; FindAtom: PROC[proc: PROC[atom: ATOM] RETURNS [stop: BOOL]] RETURNS[ATOM]; NILNotAnAtom: ERROR; END. nAtom.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Warren Teitelman, October 26, 1982 4:15 pm Paul Rovner September 19, 1983 8:43 pm Russ Atkinson (RRA) January 31, 1985 2:30:17 pm PST Beach, February 23, 1985 9:33:07 am PST Doug Wyatt, February 24, 1985 8:14:50 pm PST Atoms provide a means for canonicalizing ropes. Because of the support for ATOM literals, atoms provide a fast and easy means for testing against a small set of keywords. As in Lisp, atoms can also have property lists, although this usage is discouraged, since multiple applications can have their property lists collide to mutual discomfort. An alternative (and usually preferable) way of associating information with unique keys that can be arbitrary REFS, in a non-global fashion using specific structures (hash tables) is provided by RefTab. Types Creating Atoms ... returns the atom with pname = "" The following identity holds: Rope.Equal[r1,r2] <=> MakeAtom[r1] = MakeAtom[r2]. In particular, MakeAtom[""] = MakeAtom[NIL] = emptyAtom. Note that NIL # MakeAtom[NIL]. PNames Property list operations Enumeration of atoms Errors Κω– "Cedar" style˜codešœ ™ Kšœ Οmœ1™