duck-typing ...

May 30, 2020 01:23



t:([] k:`a`b`a; v:1 2 3)
select k, v, kk:?[1=v mod 2; {`$a,a:string x} each k;k] from t
k k1 v
-------
aa a 1
b b 2
aa a 3

select k, v, kk:?[1=v mod 2; {`$a,a:string x} each k;k] from 0#t
'type
[0] select k, v, kk:?[1=v mod 2; {`$a,a:string x} each k;k] from 0#t

The root cause of the problem is quite simple:

type {x} each `a`b
11h
type {x} each `$()
0h // brakes everything, because ?[] check type of the second argument

kdb, q

Previous post Next post
Up