KDB/k:创建table变量的函数形式

KDB/k: Functional form to create a table variable

是否有等价于下面的函数形式?

trades:([]date:`date$();time:`time$();sym:`symbol$();price:`real$();size:`int$(); cond:`char$())

假设函数名称是"ct"...

行业:ct[字段名称;类型]

ct:{[fields;types] flip fields!types$\:()}

示例:

q)ct[`date`time`sym`price`size`cond;`date`time`symbol`float`long`symbol]
    date time sym price size cond
    -----------------------------

也适用于 char 形式的类型:

q)ct[`date`time`sym`price`size`cond;"dtsfjs"]
    date time sym price size cond
    -----------------------------