add an example for reduce to the output of )d op reduce
======================================================================
diff --git a/changelog b/changelog
index 056933f..d6cf2ec 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,4 @@
+20080904 tst src/algebra/aggcat.spad add reduce example        
 20080901 tpd src/input/Makefile add start of multivar poly tests
 20080901 tpd src/input/bini.input add start of multivar poly tests
 20080831 tpd src/algebra/algfact.spad graphviz dotfile decoration
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 7212a34..d137a42 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -313,9 +313,14 @@ Collection(S:Type): Category == HomogeneousAggregate(S) 
with
    if % has finiteAggregate then
       reduce: ((S,S)->S,%) -> S
        ++ reduce(f,u) reduces the binary operation f across u. For example,
-       ++ if u is \axiom{[x,y,...,z]} then \axiom{reduce(f,u)} returns 
\axiom{f(..f(f(x,y),...),z)}.
+       ++ if u is \axiom{[x,y,...,z]} then \axiom{reduce(f,u)} 
+        ++ returns \axiom{f(..f(f(x,y),...),z)}.
        ++ Note: if u has one element x, \axiom{reduce(f,u)} returns x.
        ++ Error: if u is empty.
+        ++
+        ++C )clear all
+        ++X reduce(+,[C[i]*x**i for i in 1..5])
+
       reduce: ((S,S)->S,%,S) -> S
        ++ reduce(f,u,x) reduces the binary operation f across u, where x is
        ++ the identity operation of f.


_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to