I do not agree with the radical statement that there should not be (non-canonical) coercions in that direction. There is a coercion from QQ to ZZ. Why shouldn't there be a coercion from a polynomial ring to its base ring? Sage should mimic the way mathematicians think.
I agree that perhaps this situation can be recognized automatically. Michel On May 22, 11:53 am, "David Roe" <[EMAIL PROTECTED]> wrote: > These are all basically examples of sections of injective canonical maps > going the other direction. There clearly shouldn't be a coerce method going > that direction because the objects are not isomorphic. If we switch to a > data-driven, category theoretic coercion system, it should be possible to > recognize this kind of situation and handle it appropriately. Personally, > I'd like to see what comes out of discussions at SD4 (or before too I > suppose) on the feasibility of such an extension to Sage's coercion model, > and how it would work. > David > > On 5/22/07, Michel <[EMAIL PROTECTED]> wrote: > > > > > > I'm concerned that your proposal, if I understand it correctly, > > > will make it difficult to avoid infinite loops. Could you flesh > > > out your proposal more, and specifically address issues > > > involving infinite loops? > > > I guess this was more of an idea than a proposal. But given > > the rethinking of the coercion model it is perhaps appropriate > > to raise it. > > > To address your concerrn wouldn't it be sufficient to specify that > > > _noncanonical_into_ > > > should *not* call R(self). Or if it *really* wants to then it should > > do R._call_(self) (single underscore). > > > In the examples I have in mind things are pretty simple. > > Constant diagonal matrices --> base ring. > > Fraction field element-> base ring (if the denominator is a unit) > > Constant polynomials -> base ring. > > Field extension -> base field (if applicable) > > > etc... > > > Michel --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---