I understand white space matters in q code. Where does it matter?
Tuesday, March 8, 2011 at 11:00PM
kdbfaq in Syntax, quirks, white space

The latter rule applies, for example, to functions. The following is not valid q:

f: {[x]
x}

Even a function's closing brace must be indented if it appears on a line by itself:

f: {[x]
x
}

Function definition is not the only time you have to be careful to follow this rule, however. In the following example, g is not the list (47; 48); rather, g is a projection of the comma operator with its first argument set to 47:

g: 47,
48

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.