2015-12-01 10:29 GMT+01:00 Nicolai Hess <[email protected]>:

>
>
> 2015-12-01 10:26 GMT+01:00 Sven Van Caekenberghe <[email protected]>:
>
>>
>> > On 01 Dec 2015, at 10:24, Thierry Goubier <[email protected]>
>> wrote:
>> >
>> > Note that the sum with #anyOne is wrong.
>> >
>> > #(1 2 3 4 5) inject: #(1 2 3 4 5) anyOne into: [ :sum :each | sum +
>> each ]
>> >
>> > returns 16 instead of 15.
>>
>> You have subtract the element you picked with #anyOne !
>>
>
> I think he means the suggested implementation for newSum is wrong, just
> because of this reason.
>
> Exactly ;)

Thierry

Reply via email to