[Aldor-l] [open-axiom-devel] [fricas-devel] Re: coercion problem
Ralf Hemmecke
ralf at hemmecke.de
Sat Nov 15 06:15:27 EST 2008
On 11/15/2008 11:09 AM, Martin Rubey wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
>
>>> But I hesitate to write
>>> UnivariatePolynomial(var, R) == with Join(CoercibleTo SUP R,
>>> CoercibleTo Polynomial R,
>>> CoercibleTo DMP([var], R),
>>> CoercibleTo MPOLY([var], R) ...)
>>> This doesn't look right.
>> Doesn't seem to look right. But how else would you want to export
>>
>> coerce: % -> X
>>
>> for any of the replacements for X from above? They must statically be given at
>> compile time or (if "extend" where available) could be added later (but also at
>> compile time).
>
> Yes, *exactly* this was my question. And since I think it's a language
> problem, I also sent it to aldor-l.
What about putting
toHere: (X: UPOLYC) -> X -> %
into the category of UPOLYC and then
toHere(X: UPOLYC)(x: X): % == coerce(x)$UPOLYCoerce(X, %)
as default implementation?
It's not exactly like a simple coerce, but you get rid of explicitly
stating all the CoercibleTo X exports.
Ralf
More information about the Aldor-l
mailing list