Re: No default value for array-reduce on empty arrays
Per Bothner 13 Jun 2022 22:48 UTC
On 6/13/22 14:44, Alex Shinn wrote:
> I think it's fine to raise an error in this case. We can't predefine an alist of
> all possible identities, and if you add an identity argument there's no useful
> difference between reduce and fold.
If you had "procedure properties", it would be reasonable to check for an 'identity property.
Barring that, you could call op with zero arguments.
Works for many procedures you would pass to reduce.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/