Closed tavmem closed 4 years ago
In the k2.0 reference manual
Each Pair applies its argument function f to successive pairs of consecutive items in the list argument y.
If y is a list of count at least two, then f':x is a list withcount (#x)-1
and the ith item of the result is f[x[i+1];x[i]].
For example:
-': 1 4 9 14 25 36
3 5 5 11 11
This works in kona:
-': 1 4 9 14 25 36
3 5 5 11 11
Also in the k2.0 reference manual:
The dyadic case x f':y is defined in terms of the monadic as (,x),f':y.
Clearly, it's the dyadic case that is broken, since in kona and in k2.8:
,': 3 4 5
(4 3
5 4)
2 of the 3 cases have been fixed. Now, in kona:
1 2 ,': 3 4 5
(1 2
4 3
5 4)
(,':) . (1 2;3 4 5)
,3 4 5 1 2
{x,':y} . (1 2;3 4 5)
(1 2
4 3
5 4)
After making all Each Pair tests consistent with k2.8 results, 3 tests fail:
Failed. These are not equal:
10 1 , ."10 -': 2 3"
********************************
10 1
--------------------------------
8 1
Failed. These are not equal:
10 , ."10 -': 2"
********************************
10
--------------------------------
8
Failed. These are not equal:
10 , ."10 +': 2"
********************************
10
--------------------------------
12
After the last changes, we get another inconsistency in kona:
10 -': 2 3
8 1
10 -'': 2 3
10 1
The 2 fails that are left:
Failed. These are not equal:
(1 2;4 3;5 4) , ."(,':) . (1 2;3 4 5)"
********************************
(1 2
4 3
5 4)
--------------------------------
,3 4 5 1 2
Failed. These are not equal:
10 1 , ."10 -': 2 3"
********************************
10 1
--------------------------------
8 1
Lsst one to fix:
Failed. These are not equal:
(1 2;4 3;5 4) , ."(,':) . (1 2;3 4 5)"
********************************
(1 2
4 3
5 4)
--------------------------------
,3 4 5 1 2
in k2.8
in kona