summaryrefslogtreecommitdiff
path: root/module/tables.m
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/tables.m
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'module/tables.m')
-rw-r--r--module/tables.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/module/tables.m b/module/tables.m
new file mode 100644
index 00000000..62f589a8
--- /dev/null
+++ b/module/tables.m
@@ -0,0 +1,24 @@
+Tables: module {
+ PATH: con "/dis/lib/tables.dis";
+ Table: adt[T] {
+ items: array of list of (int, T);
+ nilval: T;
+
+ new: fn(nslots: int, nilval: T): ref Table[T];
+ add: fn(t: self ref Table, id: int, x: T): int;
+ del: fn(t: self ref Table, id: int): int;
+ find: fn(t: self ref Table, id: int): T;
+ };
+
+ Strhash: adt[T] {
+ items: array of list of (string, T);
+ nilval: T;
+
+ new: fn(nslots: int, nilval: T): ref Strhash[T];
+ add: fn(t: self ref Strhash, id: string, x: T);
+ del: fn(t: self ref Strhash, id: string);
+ find: fn(t: self ref Strhash, id: string): T;
+ };
+
+ hash: fn(s: string, n: int): int;
+};