← BYTES
KDB·Starter·Ref: 33.1.4

In q, expressions are evaluated in which order?

Have a question about this video? Mention reference 33.1.4 when you contact us.

a.Right to left
b.Left to right, like most mainstream languages
c.Outside-in, evaluating the outermost function first
d.q has no defined evaluation order
q evaluates right to left with no operator precedence beyond that rule -- `2+3*4` is `2+(3*4)`... actually in q it is `2+(3*4)` evaluated right-to-left meaning the rightmost expression is evaluated first, giving 14, the same numeric result as left-to-right here, but the ORDER of evaluation, which matters for side effects and more complex expressions, is strictly right to left.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES3314#KDB