diff options
author | dos-reis <gdr@axiomatics.org> | 2013-05-20 01:42:53 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-05-20 01:42:53 +0000 |
commit | fbd568f015c15b821f8eeb2acc7e00c13b01bde4 (patch) | |
tree | b448ac441a5222364c1e076b52552142500375bc | |
parent | 9f93bd1e41e901891fe77f2a777fd18ead4b94dc (diff) | |
download | open-axiom-fbd568f015c15b821f8eeb2acc7e00c13b01bde4.tar.gz |
Tidy KeyedDictionary
-rw-r--r-- | src/algebra/aggcat.spad.pamphlet | 5 |
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 == |