I don't think anyone is objecting to being able to add a list of
vectors (or any other objects which can be added).  But in my example,
V.sum(W)   is taking the (infinite) list of elements of W and adding
them up, which has nothing at all to do with V.  Just replace QQ by a
finite field in my example, so that it does make sense to add up all
of the elements of W.    Then certainly sum(W) should do this
addition.  But why should V.sum() accept as arguemt a list of things
*which are not elemments of V* ???  In fact, why is there a function
V.sum() at all?   The only way in which V.sum() refers back to V is
that the sum is initialized to V.zero().

John

On 8 November 2012 12:26, Simon King <simon.k...@uni-jena.de> wrote:
> Hi David and John,
>
> On 2012-11-08, David Loeffler <d.a.loeff...@warwick.ac.uk> wrote:
>> It is *really awful* that V.sum(W) attempts to sum all the elements of
>> W! I don't know what general design decision underlies this but I
>> don't like it.
>
> That's easy to explain. All additive semigroups should be able to sum up a
> list of their elements. Hence, such as summation method is defined by
> the category framework.
>
> Apparently it not only accepts a list, but any iterable.
> Problem: Vektor spaces may be infinite, but are iterable.
>
> Solution: The sum() method (and prod() similarly) should accept
> iterables *of finite length*. Hence if you have a vector space V
> and len(V) raises an error (this is what it currently does) or
> returns Infinity, then V.sum(V) should raise an error.
>
> Other solution: Rename sum() to sum_of_elements(). I don't like it.
>
> Cheers,
> Simon
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> 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.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
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.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to