The Atom structure provides hashed strings that have fast
equality testing. The Util Library provides predefined
finite maps and sets of atoms, as well as hash tables keyed by atoms.
Synopsis
signature ATOM
structure Atom : ATOM
Interface
type atom
val atom : string -> atom
val atom' : substring -> atom
val toString : atom -> string
val same : (atom * atom) -> bool
val sameAtom : (atom * atom) -> bool
val compare : (atom * atom) -> order
val lexCompare : (atom * atom) -> order
val hash : atom -> word
Description
type atom-
The abstract type of hashed strings that support fast equality testing.
val atom : string -> atom-
atom sreturns the unique hashed representation of the stringsas an atom. val atom' : substring -> atom-
atom ssreturns the unique hashed representation of the substringssas an atom. val toString : atom -> string-
toString atmreturns the string representation of the atomatm.
val same : (atom * atom) -> bool-
same (atm1, atm2)returns true if the two atoms are the same (i.e., their string representations are equal). val compare : (atom * atom) -> order-
compare (atm1, atm2)returns the relation of the two atoms in some unspecified total order. UselexCompareto compare atoms lexicographically.
val lexCompare : (atom * atom) -> order-
compare (atm1, atm2)returns the relation of the two atoms in lexical order. val hash : atom -> word-
hash atmreturns a hash key for the atom.
Deprecated functions
The following functions are part of the interface, but have been deprecated.
val sameAtom : (atom * atom) -> bool-
Use
sameinstead.