Hello

what is wrong with the following code:

----------------------------------------------------------------
#include "axiom"

extend List (R:Ring) :  with {
          sumlist:(ll: %)->R;
} == {add {
                sumlist ( ll: %) : R == {
                        s: R :=0;
                        for x:R in generator ll repeat  s:= s+x;
                        return s
                }
        }
}
----------------------------------------------------------------

it compiles fine, but then I get

(1) -> sumlist [1,2,3]
 1) ->
   >> System error:
   Caught fatal error [memory may be damaged]

this happens on debian stable, Axiom+Aldor from April 2006,
(axiom-aldor-20060621.tgz as available on axiom-developer.org).
I was wondering how to implement a "generic" sumlist function.

thanks
Franz


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

Reply via email to