Am i doing something wrong while calling rotate?

     I’m trying to implement Conway’s game of life in the Q programming language and i’m using the trial version. Generating the first version of the matrix is easy, but then the algorithm i’m following requires shifting the matrix up, down left and right. This works -“1 rotate a”, and this also works “1 rotate a” and also works fine when combining them with -1 1 rotate : a. When i try to rotate to left and right i first tried 1 rotate /: a and all i got was rotate’s definition from q.k . Since 1 rotate a[0] works i can’t figure why applying /: does not , seeing how it’s supposed to apply the diadic function rotate to each element of a. a is defined like this in case you were wondering : a: 4 4#16?2.

Thanks in advance, and glad to be part of this community. K looks like a really cool language, even if it’s wrapped in q

Whitespace is not allowed between the function and the adverb. This should work

1 rotate/: a

Thanks guys,

It took a while to figure why this (1 0 -1 rotate’:) a worked, and in the end , after rereading the each left definition , i ended up with the explanation that we get 3 different rotate funtions (1 0 and -1) and the second argument is then applied to each of them. I’m familiar with currying but what got me really confused is the name (each left).