Dear Robert, On Sat, Feb 14, 2009 at 03:57:07PM -0800, Robert Bradshaw wrote: > ... > > Would it be possible to add the following functionality (with whatever > > appropriate syntax): > > > > declare_conversion(source, target, morphism) > > > > which would adds the morphism from source to target to the conversion > > list (and probably similarly for coercions). Having some restrictions > > on it (like making sure it's called before any coercion/conversion is > > attempted) is no problem. > > > > This functionality will make it possible for each category to > > automatically declare the relevant morphisms, independently of the > > other categories (like if A is in Algebras(K), then this category will > > declare the natural morphism from K to A). > > This functionality is certainly possible, but the decision was made a > long time ago that Parents are supposed to be immutable. One problem > is that asserting embeddings can drastically change how things > operate globally, and one of the goals of coercion is to be stateless > (from the user's point of view, of course it caches things for speed) > and consistent. However, I can see how a command like this could be > very useful. The restriction that it be called before any coercion > take place seems very reasonable to me (and I'm less worried about > conversions, but better safe than sorry). I'd like to have feedback > from other people too though--I remember last time this came up there > was concern over the problems Magma's "assert embedding" caused.
For the record, we had no trouble with this with MuPAD, despite a really non-trivial coercion graph (but we also had no advanced coercion attempts like pushouts computations). How much time would it take you to write a quick draft of function like this? It would be great if I could experiment with it in the short term, and see how it feels (and decide how strong or not I'll push forward its use). > Another thing that we talked about way back, but never got around to > implementing, was contextual coercions, e.g. > > with embedding(...): > do stuff using that coercion > # coercion doesn't work anymore here Again for the record, I never had a use for this myself; but this doesn't say anything about others! Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---