prior¶
Wrapper for the Each Prior iterator
v2 prior x prior[v2;x]
(vv)prior x prior[vv;x]
Where
v2is a binary applicable valuevvis a variadic applicable value
applies v2 or vv to each item of x and the item preceding it, and returns a result of the same length.
That is, the projections prior[v2;] and prior[vv;] are uniform functions.
q)(+) prior til 10
0 1 3 5 7 9 11 13 15 17
q){x+y%10}prior til 10
0n 1 2.1 3.2 4.3 5.4 6.5 7.6 8.7 9.8
prior is a wrapper for the Each Prior iterator, which describes how q determines the first item of the result.
Prefer prior to the Each Prior iterator, except where you compose iterators and brevity helps.