Each prior: Difference between revisions

From The K Language Wiki
Content added Content deleted
(add eachprior)
 
(add johne difference suggestion)
Line 6: Line 6:


<pre>
<pre>
+':1 2 3 4 5
-':1 6 2 3 4
1 3 5 7 9
1 5 -4 1 1


5+':1 2 3 4 5
5-':1 6 2 3 4
6 3 5 7 9
-4 5 -4 1 1
</pre>
</pre>

Revision as of 03:34, 28 July 2021

Each prior
f':x
x f':y

Each prior applies a two argument function(dyad) to each element, and the element prior to it.

If provided with a left argument, uses it as an initial value.

 -':1 6 2 3 4
1 5 -4 1 1

 5-':1 6 2 3 4
-4 5 -4 1 1