Bill Allombert on Thu, 17 Oct 2013 20:12:42 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: gp/pari version of the "Map" datatype and "reduce" function


On Thu, Oct 17, 2013 at 01:11:18PM -0400, Charles Greathouse wrote:
> I think "fold" is good and avoids clashes.

There is the question of associativity.
I suggest we make it strictly less associative.

However to answer Richard, lots of GP functions fold automatically, or
there are variants that do:

? vecmax([1,2,3])
%2 = 3
? gcd([4,6,9])
%3 = 1
? factorback([1,2,3,4])
%4 = 24

Cheers,
Bill.