Rowan home > Reference > Reduce and Scan

Reduce and Scan Operators: / and \

Module: Main
Syntax: dfn1 / or \
Errors: R.ContextException
Keystrokes: Ctrl+K

Create a monadic function which is equivalent to inserting dfn between each pair of elements in its argument. The function produced by \ records each step in its result, / returns only the final answer.

For example:

   1+2+3+4+5
Result: 15
   +/(1 2 3 4 5)
Result: 15
   +\(1 2 3 4 5)
Result: (1 3 6 10 15)

The ContextException is thrown if dfn is not dyadic.