Hacker News new | ask | show | jobs
by leprechaun1066 1242 days ago
K4 is the implementation language of q, kdb is the database part of the language. Most q is just named utility functions written in K4. There isn't really much difference in what the machine does with them under the covers, but when stuck on a problem talking about q is more likely to get help than k.

You can provide up to 8 named inputs in a function definition.

q example for running sum of 8 inputs:

  q)f:{[a;b;c;d;e;f;g;h]sums a,b,c,d,e,f,g,h}
same in K4:

  q)\
  f:{[a;b;c;d;e;f;g;h]+\a,b,c,d,e,f,g,h}