kdb:$ 函数可以接受 5 个参数吗?
kdb: can the $ function take 5 arguments?
来自https://code.kx.com/q/wp/parse-trees/#the-solution
我遇到了下面的函数,它将入伍符号或符号列表转换为字符串“enlist”。
ereptest:{ //returns a boolean
(1=count x) and ((0=type x) and 11=type first x) or 11=type x}
ereplace:{"enlist",.Q.s1 first x}
funcEn:{$[ereptest x;ereplace x;0=type x;.z.s each x;x]} <<<<<
在最后一行,似乎 $
应用于 5 个参数,但 this page 显示 $
是等级 2 或 3。我在这里缺少什么?
来自kx wiki
Odd number of expressions
For brevity, nested triads can be flattened.
$[q;a;r;b;c] <=> $[q;a;$[r;b;c]]
These two expressions are equivalent:
$[0;a;r;b;c]
$[r;b;c]
来自https://code.kx.com/q/wp/parse-trees/#the-solution
我遇到了下面的函数,它将入伍符号或符号列表转换为字符串“enlist”。
ereptest:{ //returns a boolean
(1=count x) and ((0=type x) and 11=type first x) or 11=type x}
ereplace:{"enlist",.Q.s1 first x}
funcEn:{$[ereptest x;ereplace x;0=type x;.z.s each x;x]} <<<<<
在最后一行,似乎 $
应用于 5 个参数,但 this page 显示 $
是等级 2 或 3。我在这里缺少什么?
来自kx wiki
Odd number of expressions
For brevity, nested triads can be flattened.
$[q;a;r;b;c] <=> $[q;a;$[r;b;c]]
These two expressions are equivalent:
$[0;a;r;b;c] $[r;b;c]