> On 22 Dec 2015, at 10:22, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
>
>
>
> 2015-12-22 3:46 GMT+01:00 Ben Coman <btc@openinworld.com>:
> On Wed, Dec 2, 2015 at 3:38 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
> > I am saying that if you want sum: to be generic, it cannot assume a *specific* Zero object.
> > And sum:�� should be generic because of its name.
>
> This seems the crux of the disparate viewpoints, which is why I
> suggested return a *generic* Zero object as follows...
>
> > On 04 Dec 2015, at 01:49, Ben Coman <btc@openInWorld.com> wrote:
> > do something like...
> >
> >�� �� Collection>>sum
> >�� �� �� ��| sum sample |
> >�� �� �� ��self isEmpty ifTrue: [ ^ ArithmeticZero ].
> >�� �� �� ��sample := self anyOne.
> >�� �� �� ��sum := self inject: sample into: [ :accum :each | accum + each ].
> >�� �� �� �� ^ sum - sample
>
>
> Nice, but generic zero can't work: you sometimes need to decide if it is the zero of vector space, or of associated field.
> The generic zero can't behave as both say a matrix and a scalar...
Indeed, that is what I said the first time Ben proposed this.
But I am curious, Nicolas, what you think of this, with your math background/interest ?