Search code examples
kdb

kdb: does a leading plus sign mean a Q table?


I often see output like +`col1`col2`col3!(,`a`b`c;,{x+1};,()!()). I suspect it means a table, but wasn't able to find documentation on this syntax.

What does the leading + mean? Could someone provide a link to a reference page?


Solution

  • It's notation in K, the language Q operations are built in. + is the flip operator when used monadically, and internally tables are referred to as Flips.

    In Q, flip is built from this and the : operator, which forces the + to be interpreted monadically. Similarly for the where keyword:

    q)flip
    +:
    q)where
    &: