Re: New names for some operations
taylanbayirli@xxxxxx 14 Sep 2015 09:38 UTC
xxxxxx@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:
> Shiro Kawai <xxxxxx@gmail.com> writes:
>
>> On Sun, Sep 13, 2015 at 10:11 AM, John Cowan <xxxxxx@mercury.ccil.org>
>> wrote:
>>
>> The difference between reduce and fold is that the seed value is
>> used only when the sequence being reduced is zero-length: it does
>> not participate in the "normal" operations.
>>
>> Hm, if it's the consensus, then it implies reduction function is
>> indeed to be expected a -> a -> a (having the element and accumulated
>> value are of the same type), and my suggestion loses the point.
>> Taylan, you may want to hold the change until we discuss more.
>
> Indeed, I'll hold back. Need to think more about this.
I decided to go back to "sum" because one wouldn't actually confuse it
with numeric summation, the documentation makes it clear that there is
no '(a, a) -> a' type restriction on the procedure, and "sum" sounds
strongly non-ordered whereas "reduce" can still be thought of as ordered
due to its semantics in SRFI-1, other languages, and similarity to fold.
Taylan