Hi, Le dimanche 30 avril 2006 à 09:23 -0700, Bob McElrath a écrit :
[...] > Thanks for the hint but it still doesn't work. If I read teh above > correctly, it should be used like: > > x::MathMLFormat1(OutputForm) > > Cannot convert from type Variable x to MathMLFormat1 OutputForm for > value x No, MathMLFormat1 is a package and not a domain. It's usage is to coerce elements that inherit from SetCategory to MathMLFormat (SetCategory exports the function 'coerce : % -> OutputForm' so this coercion can be used in this package) So its usage is (for example): coerce(x)$MathMLFormat1(POLY INT); > So then I try manually converting to OutputForm first: > > x::OutputForm::MathMLFormat1(OutputForm) > > Cannot convert from type OutputForm to MathMLFormat1 OutputForm for > value x > > what am I doing wrong? To coerce any element to MathMLFormat without the MathMLFormat1 package you have to coerce the element to OupuForm first since the coerce function in MathMLFormat is of the form 'coerce: OuptutForm -> $': x::OutputForm::MathMLFormat; The MathMLFormat1 package is just an utility package to avoid to coerce element to OutputForm first (the interpreter will directly use this package). So now you can use: x::MathMLFormat; But note that there is always a semicolon at the end of the command (sorry I forgot to insist on this point). If you remove the semicolon you'll get the error message: The function coerce with signature hashcode is missing from domain MathMLFormat The interpreter here try to coerce the MathMLFormat element to OutputForm (to print it on the screen) so you have to implement the function 'coerce: $ -> OutputForm' in the MathMLFormat domain. Hope that helps, Cheers, Greg > > Thanks, > Bob McElrath [Univ. of California at Davis, Department of Physics] > > "It is almost universally felt that when we call a country > democratic we are praising it; consequently, the defenders of every > kind of regime claim that it is a democracy, and fear that they > might have to stop using the word if it were tied down to any one > meaning." -- George Orwell _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer