« How do I delete the nth row from a table? | Main | What kdb connection libraries exist? »

What does it mean for a q function or table to be a ‘first class’ type?

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

  • pass them as arguments to other functions
  • return them from functions
  • create new functions at run time

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).

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Textile formatting is allowed.