Inside verb v we have two local variables: x and y.
x - left verb argument, y - right verb argument.
Array for Fold located in right part of expression: 7 ] F:. see_arg 1 2 3 4
I see more intuitiveness if numbers from right array 1 2 3 4 would be passed
as right argument of verb 'see_arg'.
23.02.2021 19:58, Raul Miller:
Here's an illustration of how the fold multiple works:
V=: {{x+y [ echo x,y}}
i1,i2,i3,i4=.(i3=.(i2=.(i1=. 7 V 1)V 2)V 3)V 4
7 1
8 2
10 3
13 4
8 10 13 17
And, here is how it would be if we swapped argument order:
V=: {{y+x [ echo y,x}}
i1,i2,i3,i4=.(i3=.(i2=.(i1=. 7 V 1)V 2)V 3)V 4
1 7
2 8
3 10
4 13
8 10 13 17
So, once again, I am asking: why should we think that the second
approach would be more intuitive than the first approach?
Thanks,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm