I tend to agree. Why would the control-like vs data-like change from F: to v? If you want v~ you should write v~ telling the reader what semantics you actually want, improving readability/documentation. And if you want to fold on y,x or x,y you should again write just that. Imo, the only reason for the current order is the equivalent spelling when x is made part of y That’s a worse reason than consistent usage of control-like vs data-like.
Am 22.02.21 um 13:31 schrieb 'Sergey Kamenev' via Programming: > I'm talking about the order of the arguments within a verb 'see_arg'. > > Inside the verb 'see_arg', the initial value must be passed as the left > argument, and then > (on next iteration) the result of the fold. > > And as the right value, the values from the collapsing array must be > passed. > > The direction of the fold shouldn't matter. > > Here are the results if you make the order of the arguments for the verb > 'see_arg' more intuitive: > > see_arg =: dyad : 0 > NB. See argument order > echo x, y > x + y > ) > > 7 ] F:. see_arg 1 2 3 4 > > 7 1 > 8 2 > 10 3 > 13 4 > 8 10 13 17 > > 7 ] F:: see_arg 1 2 3 4 > 7 4 > 11 3 > 14 2 > 16 1 > 11 14 16 17 > > Sergey. > > 21.02.2021 22:34, Raul Miller пишет: >> I have a question about your proposal: >> >> 7 ] F:: see_arg 1 2 3 4 >> 4 7 >> 3 11 >> 2 14 >> 1 16 >> 11 14 16 17 >> >> The right to left folds pass arguments in a right to left fashion. >> >> But why should this be the case for a left to right fold? >> >> (I am trying to understand why a left to right fold should be >> intuitively thought of as having a right to left pattern. I am not >> saying you are wrong about that, but I am having trouble coming up >> with an example where this would make more sense.) >> >> Thanks, >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- ---------------------- mail written using NEO neo-layout.org ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
