Stephen Mosher (via RT) wrote:
Attached is a diff against rakudo/src/core/Any-list.pm which adds support to
reduce() for higher-arity functions. It ensures arity-list agreement and is
generally safe. Other than the  test, the functionality was already
present... it  needed two lines commented out, two uncommented. Since tests
passed and there were no explanatory comments in the file, jnthn suggested I
mail in a diff. Here it is.

What is a common or fundamentally important example of an N-adic function whose base operation takes 3 or more operands, such that reduce() would be useful?

I suppose that something like ??!! might conceivably fit the bill since it can be arbitrarily chained and is self-similar, but probably not, considering that it isn't commutative or associative, but rather just recursive, so I'm not sure that reduce() applies here.

-- Darren Duncan

Reply via email to