This should be an FAQ because we have discussed it several times :-)

The short answer is that, in all flavours of AXIOM, if you assign to Rep
then you are asking for implicit coercions between % and Rep -- and that
can lead to unfunny situations as above.

The proper way is to define Rep as a constant, i.e. Rep == X.

Oh, I thought, that just OpenAxiom changed it to using "Rep==X". If I understood correctly, in FriCAS "==" does not mean constant definition but rather "delayed assignment".

>grep '^[ \t]*Rep *:=' *|wc -l
239

>grep '^[ \t]*Rep *==' *
ffrac.as.pamphlet:  Rep == Record(num : X, den : X) ; -- representation
herm.as.pamphlet:  Rep ==> Vector R;
interval.as.pamphlet:  Rep ==> Record(Inf:R, Sup:R);
newdata.spad.pamphlet:     Rep ==> VTB
newdata.spad.pamphlet:     Rep ==> A
newpoly.spad.pamphlet:     Rep ==> List Term
regset.spad.pamphlet:     Rep ==> LP
sregset.spad.pamphlet:     Rep ==> LP
triset.spad.pamphlet:     Rep ==> LP
triset.spad.pamphlet:     Rep ==> LP

So in the FriCAS sources, there is only *one* instance with ==. And interestingly, this is not SPAD, but an Aldor program.

So I assume, in FriCAS, I will rather have to use ==> instead of ==.
I've tried both, and for ==> as well as for ==, I can do without $X.

Waldek, what would you suggest? I definitely want rep and per. Would be good, if they were defined automatically, but for the moment I can live with defining them myself. Using rep and per just helps me to keep track of the difference between % and Rep. Automatic coercion should not be done for SPAD programs, not even between % and Rep.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to