aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/aggcat.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-21 19:08:40 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-21 19:08:40 +0000
commit4d2e40994f313341a18c6a488826e5c79ed0ee6b (patch)
tree75032de59781ff2f5c620dfe4414c22234d1ffb4 /src/algebra/aggcat.spad.pamphlet
parent547ab00c39512aa5d0909e182c12e930fbc9277a (diff)
downloadopen-axiom-4d2e40994f313341a18c6a488826e5c79ed0ee6b.tar.gz
* algebra/aggcat.spad.pamphlet (UnaryRecursiveAggregate) [map!]:
Implement default. * algebra/list.spad.pamphlet (List) [map!]: Likewise.
Diffstat (limited to 'src/algebra/aggcat.spad.pamphlet')
-rw-r--r--src/algebra/aggcat.spad.pamphlet14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 2dd2fc74..512bf628 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -1662,6 +1662,13 @@ UnaryRecursiveAggregate(S:Type): Category == RecursiveAggregate S with
setrest!(x, empty())
y
+ map!(f,x) ==
+ y := x
+ while not empty? y repeat
+ setfirst!(y,f first y)
+ y := rest y
+ x
+
@
\section{category STAGG StreamAggregate}
@@ -1735,13 +1742,6 @@ StreamAggregate(S:Type): Category ==
empty? l => empty()
concat!(copy first l, concat rest l)
- map!(f, l) ==
- y := l
- while not empty? l repeat
- setfirst!(l, f first l)
- l := rest l
- y
-
fill!(x, s) ==
y := x
while not empty? y repeat (setfirst!(y, s); y := rest y)