aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/aggcat.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-20 01:42:53 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-20 01:42:53 +0000
commitfbd568f015c15b821f8eeb2acc7e00c13b01bde4 (patch)
treeb448ac441a5222364c1e076b52552142500375bc /src/algebra/aggcat.spad.pamphlet
parent9f93bd1e41e901891fe77f2a777fd18ead4b94dc (diff)
downloadopen-axiom-fbd568f015c15b821f8eeb2acc7e00c13b01bde4.tar.gz
Tidy KeyedDictionary
Diffstat (limited to 'src/algebra/aggcat.spad.pamphlet')
-rw-r--r--src/algebra/aggcat.spad.pamphlet5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 41b6ab6b..26375731 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -189,6 +189,7 @@ FiniteAggregate(S: Type): Category == Exports where
++ shapes.
ShallowlyMutableAggregate(S: Type): Category == Exports where
Exports == HomogeneousAggregate S with
+ shallowlyMutable
map!: (S->S,%) -> %
++ \spad{map!(f,u)} destructively replaces each element
++ \spad{x} of \spad{u} by \spad{f(x)}
@@ -849,7 +850,8 @@ import List
++ A keyed dictionary is a dictionary of key-entry pairs for which there is
++ a unique entry for each key.
KeyedDictionary(Key:SetCategory, Entry:SetCategory): Category ==
- Join(Dictionary Record(key:Key,entry:Entry),IndexedAggregate(Key,Entry)) with
+ Join(Dictionary Record(key:Key,entry:Entry),IndexedAggregate(Key,Entry),_
+ ShallowlyMutableAggregate Entry) with
key?: (Key, %) -> Boolean
++ key?(k,t) tests if k is a key in table t.
keys: % -> List Key
@@ -1098,7 +1100,6 @@ TableAggregate(Key:SetCategory, Entry:SetCategory): Category ==
table l == dictionary l
-- empty() == dictionary()
- insert!(p, t) == (t(p.key) := p.entry; t)
indices t == keys t
coerce(t:%):OutputForm ==