You can do whatever you need without Fold, but it has these features:

* iteration can be forward or backward through items of a noun
* initial value can be provided as its own argument
* early termination is allowed
* either one result for the whole iteration or a result item per iteration
** result of an iteration can be a subset of the complete internal state passed to the next iteration ** results of individual iterations can be put into the overall result or not * iteration can be by item or on the entire argument until a condition is met

Henry Rich



On 3/28/2020 6:25 PM, Devon McCormick wrote:
Hi -
I noticed the "fold" conjunctions only recently.  However, I was under the
impression that J already has ways to accomplish what is meant by different
kinds of folds - see
https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29#In_various_languages
  .

Can someone involved with the "F" conjunctions explain their rationale?

Thanks,

Devon


--
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to