2022.03.17 03:16 AM
sel:{$[`~y;x;select from x where sym in y]} / from u.q
My understanding is that sel returns x unless you enter a y?
If this is the case, could we not have used "x" instead of "sel[x]" in pub?
pub:{[t;x]{[t;x;w]if[count x:sel[x]w 1;(neg first w)(`upd;t;x)]}[t;x]each w t}
2022.03.17 04:53 AM
Hi,
The sel[x]w 1 , call is the same as sel[x;w 1]. So, y =w 1, which will be a list of symbols or ` if no filtering on syms is to be applied.
Then within sel function, filtering is applied if y is not equal to ` with the select from x where sym in y.
Omitting sel from the pub function would remove this functionality to subscribe to a subset of syms.
Let me know if this helps or not.
Patrick
2022.03.17 04:53 AM
Hi,
The sel[x]w 1 , call is the same as sel[x;w 1]. So, y =w 1, which will be a list of symbols or ` if no filtering on syms is to be applied.
Then within sel function, filtering is applied if y is not equal to ` with the select from x where sym in y.
Omitting sel from the pub function would remove this functionality to subscribe to a subset of syms.
Let me know if this helps or not.
Patrick
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.