What does it mean for a q function or table to be a ‘first class’ type?
Monday, March 7, 2011 at 10:47PM
kdbfaq in Language, first class function, types

Like any other value, you can do the following with functions:

In fact, since the syntax of q is consistent with the semantic similarity between calling a function and indexing a data structure, sometimes you won't even care whether a particular value is a function or data.

Tables can be treated as ordinary data as well. In a typical database, tables can only be manipulated and queried using a special language via a specific access mechanism (.NET's LINQ is Microsoft's effort to bridge the gap). In q, although you can use a query language when convenient, you can also use any other feature of the q language that you might want. For example, sometime it's much simpler or faster to express a table update using . (apply).

Article originally appeared on online book - kdb+/q faq - Kdb+ is the registered trademark of Kx Systems, Inc. (http://www.kdbfaq.com/).
See website for complete article licensing information.