[Aldor-l] Problem with extending SparseUnivariatePolynomial0
Ralf Hemmecke
ralf at hemmecke.de
Fri Mar 24 05:17:39 EST 2006
Hello,
On 03/24/2006 09:08 AM, Christian Aistleitner wrote:
> Nevertheless, I have some more usefull comment to make as well:
> If you put your code into one file, everything compiles ond works properly.
> I do not know, if this is possible for you or not ... but this may be a
> workaround.
I could not believe what Christian was writing, but it is true also on
my machine the following happens with the files below...
aldor -lalgebra -laldor -fx -DONE use.as
use
blah
x^2
foo('bar') = bar
baz
aldor -fo -fao tst.as
aldor -lalgebra -laldor -fx use.as tst.o
use
blah
Segmentation fault
The strange thing is that I was once told that the use of an "extend"ed
domain has to be in another file.
Ralf
--tst.as
#include "algebra"
extend SparseUnivariatePolynomial0(R:Join(ArithmeticType, ExpressionType),
avar:Symbol == new()):with {
foo : String -> String
} == add {
foo(s:String):String == s
}
--end tst.as
--use.as
#if ONE
#include "tst.as"
#else
#include "algebra"
#library SUP "tst.ao"
import from SUP;
#endif
#include "aldorio"
main(): () == {
import from Symbol, Integer;
import from SparseUnivariatePolynomial0(Integer, -"x");
stdout << "blah" << newline;
stdout << monomial 2 << newline;
stdout << "foo('bar') = " << foo("bar") << newline;
stdout << "baz" << newline;
}
main();
--end use.as
More information about the Aldor-l
mailing list