On Tue, May 20, 2014 at 11:50:30AM +0200, Vincent Delecroix wrote: > I agree with Nathan that .sum must be changed. IMHO I would > - remove sum from the element Composition
+1 > - move the sum from the category CommutativeAdditiveMonoids to AdditiveMagmas With #10963 (which is merged!), sum has already been moved in AdditiveMonoids. A version not using the zero (and supporting only non empty lists) could possibly be added to AdditiveSemigroups. I am not sure I want to define sum if the addition is not associative (for multiplicative magmas, prod is only defined in the associative case). > - Turn the parent Compositions into an additive monoid > > That way, the old behavior of sum can still be used through > {{{ > sage: Compositions().sum([Composition([3,2,1]), Composition([1,2])]) > [3, 2, 1, 1, 2] > }}} +1. Or maybe instead into a multiplicative monoid? I don't have a strong opinion either way, but we should take a consistent decision here with words and other word-like objects supporting concatenation. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.