atom/src/Atom.i3


Copyright (C) 1994, Digital Equipment Corp.
 An Atom.T is a unique representative for a set of equal texts
   (like a Lisp atomic symbol)
   \index{atomic symbol}
   \index{symbolic expression!atom}


INTERFACE Atom;

TYPE T <: REFANY;

CONST Brand = "Atom-1.0";

PROCEDURE FromText(t: TEXT): T;
Return the unique atom a such that for any text u, if Text.Equal(u, t), then FromText(u) = a.

PROCEDURE ToText(a: T): TEXT;
Return a text t such that FromText(t) = a.

PROCEDURE Equal(a1, a2: T): BOOLEAN;
Return a1 = a2.

PROCEDURE Hash(a: T): INTEGER;
Return a hash code for a by taking the image of ToText(a) under some fixed hash function.

PROCEDURE Compare(a1, a2: T): [-1..1];
Cause a checked runtime error.

END Atom.
Compare causes a checked runtime error because there is no default order on atoms.

Atom's implementation is in:


opaque type Atom.T is in:


procedure Atom.FromText is in:


procedure Atom.ToText is in:


procedure Atom.Hash is in: