I'd like to report on a curious problem I have with SPAD/Aldor, which Python does not seem to have.
In Axiom, we currently have the (mostly unused) Categories CoercibleTo S, RetractableTo S and ConvertibleTo S that provide coerce: % -> S, coerce: S -> % and retract: % -> S respectively. One can then ask (4) -> SquareMatrix(2, INT) has CoercibleTo Matrix INT (4) true Type: Boolean Very unfortunately, currently in almost all cases the query "has CoercibleTo Something" will return false, because the coerce function is not inherited by the category. Now, I would like that for domains of the same category, say UnivariatePolynomialCategory, that differ only in the representation of their elements, say sparse or dense, we would have A has CoercibleTo B and B has CoercibleTo A Eg., we could have a package UPOLYCoerce(A: UPOLYC, B: UPOLYC) that implements coerce: A -> B generically, using only operations from the category UPOLYC. But it seems that we cannot teach Aldor/SPAD, that for all domains A and B of UPOLYC we have A has CoercibleTo B and B has CoercibleTo A In Sage/python, this seems possible, although I'm not quite sure about it. There, people implement a general coerce method in UPOLYC, that checks whether it's argument is of the right type. I admit, I do not know whether we can then ask for two given types whether we can do the coercion. Sorry for being very vague here, I simple do not know the details. Martin ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel