aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-17 00:48:29 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-17 00:48:29 +0000
commit1d241c403c1d8e0b3f41093729efd967335c4b93 (patch)
treecc1e691489276a5d94bd7cafde17398207c84cca /src/algebra
parenta77534307be15ee6d85fbc31cc2717cae874d209 (diff)
downloadopen-axiom-1d241c403c1d8e0b3f41093729efd967335c4b93.tar.gz
* algebra/aggcat.spad.pamphlet (AssociationListAggregate) [assoc]:
Change return type to instance of Maybe. * algebra/list.spad.pamphle (AssociationList): Reflect change.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/aggcat.spad.pamphlet4
-rw-r--r--src/algebra/list.spad.pamphlet4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 83667f77..576a5a24 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -2599,9 +2599,9 @@ import ListAggregate
++ searching for a key is a linear operation.
AssociationListAggregate(Key:SetCategory,Entry:SetCategory): Category ==
Join(TableAggregate(Key, Entry), ListAggregate Record(key:Key,entry:Entry)) with
- assoc: (Key, %) -> Union(Record(key:Key,entry:Entry), "failed")
+ assoc: (Key, %) -> Maybe Record(key:Key,entry:Entry)
++ assoc(k,u) returns the element x in association list u stored
- ++ with key k, or "failed" if u has no key k.
+ ++ with key k, or \spad{nothing} if u has no key k.
@
diff --git a/src/algebra/list.spad.pamphlet b/src/algebra/list.spad.pamphlet
index 9f0cc282..78cb7133 100644
--- a/src/algebra/list.spad.pamphlet
+++ b/src/algebra/list.spad.pamphlet
@@ -506,8 +506,8 @@ AssociationList(Key:SetCategory, Entry:SetCategory):
assoc(k, t) ==
for r in deref t repeat
- k = r.key => return r
- "failed"
+ k = r.key => return just r
+ nothing
setelt(t:%, k:Key, e:Entry) ==
(r := assoc(k, t)) case Pair => (r::Pair).entry := e