2015.07.12 08:57 AM
I read page 406 in the Borror book and it would seem that there is behavior with the find (?) operator that is not addressed there:
Notice the different result depending on whether the first item of the left operand is atomic or not:
q)(1 2;3;3 4;4)?3 4 / should be 1 3 not 2!
2
q)(1;2;3;3 4;4)?3 4
2 4
This expression is documented but I'm not sure I agree with the result, it should be 2 2:
q)(1 2;3 4)?3 4
1
With the following returning the value 1:
q)(1 2;3 4)?enlist 3 4
,1
There are many more examples that appear to be inconsistent (at least according to Borror's description or simple list vs. general list left operand):
q)(1;2 3;4)?(1 2;(2 3; 4);3 4)
0 3
3 3 2
3 2
q)(1;2 3;4)?(1 2;(4;2 3);3 4)
0 3
2 1
3 2
2015.07.13 05:14 AM
2015.07.13 07:59 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.