OK, now we are getting somewhere.  I am moving this back to Programming (because I don't follow Chat).  To your points:

1. Often unnecessary: agreed.  Fold will not replace u/ etc.:
 a. it's too wordy
 b. The many ingenious optimizations in u/ will not be provided, at least not initially

2. If v is an identity, who would need Fold?
 a. often true, and they wouldn't use it then
 b. but using Z: to control iteration may be convenient
 c. Fold allows iteration front-to-back, avoiding &.|.
 d. Fold allows specifying an initial value for the first application of u

My expected application for Fold is when u is NOT a primitive.  It might be tacit or explicit, but u is going to be called for each item of y.  Fold gives a terse way to express its computation: the question is whether those computations are common enough to justify the work.  I agree with Marshall that they are.

I am open to your second-conjunction idea, though I don't see how it would work.  I considered making Fold a set of adverbs using a gerund u before settling on the proposal as written.

I have expanded the proposal to allow v to be a noun n, which would execute n&{:: .

Henry Rich



On 3/4/2018 11:56 AM, Raul Miller wrote:
I see where you are going with this now.

And, I do like the thinking. (I'd have to think a bit more, though, to
come up with good examples, for documentation purposes.)

That said, this seems like it would be unnecessary in a good number of
cases - only the "scan-like folds" really make good use of it, and
then only when v is not an identity function.

Perhaps, instead, if we can dip into symbolism a bit more, we could
introduce a second conjunction that modifies folds at the "generate
intermediate result" stage?

[Does this description make sense?]

Thanks,



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

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

Reply via email to