aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/table.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/table.spad.pamphlet')
-rw-r--r--src/algebra/table.spad.pamphlet7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/algebra/table.spad.pamphlet b/src/algebra/table.spad.pamphlet
index 12adc7f0..22984b89 100644
--- a/src/algebra/table.spad.pamphlet
+++ b/src/algebra/table.spad.pamphlet
@@ -35,14 +35,17 @@ HashTable(Key, Entry, hashfn): Exports == Implementation where
finiteAggregate
Implementation ==> add
+ import tableValue: (%,Key) -> Entry from Foreign Builtin
+ import tableLength: % -> NonNegativeInteger from Foreign Builtin
+
Pair ==> Record(key: Key, entry: Entry)
Ex ==> OutputForm
failMsg := GENSYM()$Lisp
t1 = t2 == %peq(t1,t2)$Foreign(Builtin)
keys t == HKEYS(t)$Lisp
- # t == HCOUNT(t)$Lisp
- setelt(t, k, e) == HPUT(t,k,e)$Lisp
+ # t == tableLength t
+ setelt(t, k, e) == %store(tableValue(t,k),e)$Foreign(Builtin)
remove!(k:Key, t:%) ==
r := HGET(t,k,failMsg)$Lisp
not %peq(r,failMsg)$Foreign(Builtin) =>