smart-apply ( quot n -- )
Factor handbook > The language > Combinators > Smart combinators

Prev:map-reduce-outputs ( quot mapper reducer -- quot )
Next:sum-outputs ( quot -- n )


Vocabulary
combinators.smart

Inputs and outputs
quota quotation
nan integer


Word description
Applies a quotation to the datastack n times, starting lower on the stack and working up in increments of the number of inferred inputs to the quotation.

Examples
USING: combinators.smart prettyprint math kernel ; 1 2 3 4 [ + ] 2 smart-apply [ . ] bi@
3 7


Definition