[Jprogramming] Contrintuitive argument order in Fold right verb
'Sergey Kamenev' via Programming
programming at jsoftware.com
Mon Feb 22 12:45:59 UTC 2021
The Fold array, in my opinion, looks more like 'data-like' argument and elements from him need to passed as right arguments to
right verb (to 'see_arg' in my example). But they passed as left argument to verb.
The verb actually has an initial meaning (in left part) and an array to process (right).
Initial and intermediate values can be viewed as 'control-like' values or 'data-like' values,
it is difficult to make a choice here.
The array to fold is more like an 'data-like' argument.
But if we accept your point of view, then you have to put the elements of the right array into
the left input of the verb ('see_arg'), and the initial value (initially located on the left) and
intermediate values are put into the verb as the right argument.
I think this constant shuffling makes the program more difficult to understand.
Sergey.
21.02.2021 23:32, Henry Rich:
> 'control-like' argument. The right argument is more 'data-like'
More information about the Programming
mailing list