Hi!, At http://www.sagenb.org/home/pub/2813, I have published a worksheet that aims at explaining how one can implement a new parent and take advantage of both the category framework and the coercion model (including construction functors).
My approach was to implement fraction fields step by step, so that it becomes clear what methods need to be provided for what purpose. I also tried to explain the theoretical background. The worksheet covers: * Choice of a base class for parents and elements * How to implement basic arithmetics (_add_ versus __add__, etc) * Category framework - why and how? * Unique parents * Basic coercion (trying to explain what structural properties distinguish a coercion from any odd conversion, and how to implement it) * Advanced coercion (construction functors and pushout) * Test suites. In order to be fully fuctional, the work sheet requires #8800, #9944 and #9138 to be merged. While #8800 is merged in sage-4.7 and #9944 is merged in sage-4.7.1, #9138 still needs review (hint-hint). However, I tried to work around the missing patches, so that the worksheet is usable on www.sagenb.org (with sage-4.6). Of course, I'd appreciate feedback. I'd also appreciate if the worksheet could be included into the documentation as a thematic tutorial. In another thread, I suggested to proceed with documentation similar than with spkgs: I believe that it is better to make preliminary versions of tutorials available to the public (explicitly marking them as preliminary or draft) than to wait a couple of months until someone has provided a full review. In the best case, there is feed-back from the public, so that one has a cumulative review. In particular, I think that the tutorials from the combinat branch should be published soon as well. Namely, it seems to me that the pedagogical approaches behind these texts and my text are orthogonal. Having both available would give the user the opportunity to benefit from what fits better to his or her respective learning type. What do you think? Best regards, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org