1 (* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
8 functor Symbol (S: SYMBOL_STRUCTS): SYMBOL =
13 datatype t = T of {hash: word,
15 plist: PropertyList.t}
18 fun make f (T r) = f r
21 val plist = make #plist
25 val table: t HashSet.t = HashSet.new {hash = hash}
29 val hash = String.hash s
31 HashSet.lookupOrInsert
32 (table, hash, fn T {name, ...} => s = name,
33 fn () => T {hash = hash,
35 plist = PropertyList.new ()})
38 fun foreach f = HashSet.foreach (table, f)
42 val layout = Layout.str o toString
44 fun equals (s, s') = PropertyList.equals (plist s, plist s')
47 fun make f (s, s') = f (name s, name s')
49 val op <= = make String.<=
50 val compare = make String.compare
53 val asterisk = fromString "*"
54 val bogus = fromString "<bogus>"
55 val equal = fromString "="
56 val itt = fromString "it"
57 val unit = fromString "unit"