right to left evaluation

https://learninghub.kx.com/forums/topic/right-to-left-evaluation

Hi, I'm new to q and array programming language. I'm having trouble understanding what it means to be right to left evaluation.

I was expecting the 2nd output should be 11 154 but this is not the case. I'm confused when the left operand of * operator can be list or atom. how does q determine when to stop? under what situation, q can treat 22*3+4 as one block and get 11 154?

I believe the confusion here is just based on the syntax, to the q interpreter ( 11 22 ), 11 22 or indeed ( 11; 22 ) all resolve to the same list, * being atomic is applied to each item.

To obtain your result vector of 11 154 you’d need to explicitly demarcate 11 from 12 either via parantheses as in

q) (11;22*3+4)

or via joining 11 to the result of 22*3+4

q) 11 , 22*3+4