You also can use reduce. E.g. reduce(+, [1,2,3]) Gernot Ralf Hemmecke writes:
You should have read previous posts. Axiom does not understand "extend". The following code does what you want. Just say
%axiom
)co sumlist.as
sumlist [1,2,3]
---BEGIN sumlist.as
#include "axiom"
SumPackage(R: Ring): with {
    sumlist: List R -> R;
} == add {
     sumlist (l: List R): R == {
         s: R := 0;
         for x in l repeat  s:= s+x;
         return s
     }
}
---END sumlist.as
Have fun
Ralf

_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer




_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to