On Thu, Jan 16, 2020 at 7:07 PM Bradley Lucier <xxxxxx@purdue.edu> wrote:
 
> (array-inner-product sum product a1 a2) => [...]

Is sum a "reduction" (which needs no identity element) or a "fold"
(which does)? 

It's a reduction, but the value returned by the one-argument case depends on the function itself.  Thus (- 2) is -2, which is not an identity for subtraction.  Fortunately we need not worry about the zero-argument case, as it arises only for degenerate arrays, which are not supported.

You can convert a fold f to a reduction thus:

(define (reduce f idvalue) (lambda args (apply f idvalue args)))
 
Which APL operator is this?

It's f.g, where f and g are the sum and product operators.  In addition to the dot product and matrix multiplication +.×, there are other idioms like ∨.=, which returns #t if any two vector elements, considered pairwise, are equal. 



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
How they ever reached any conclusion at all is starkly unknowable
to the human mind.        --"Backstage Lensman", Randall Garrett