cor

Does anyone know why the first version of the following code fails while the second version succeeds?

Thanks in advance,

Victor

q)cor . (0 0 0 1 2 3 4;5 6 7 8 9 0 3)' [0] cor . (0 0 0 1 2 3 4;5 6 7 8 9 0 3) ^q){cor[x;y]} . (0 0 0 1 2 3 4;5 6 7 8 9 0 3)-0.5407765

Hi, 

cor is an infix dyadic verb and so is .

You need to wrap cor in parentheses to protect it’s arguments from being applied, converting it into a noun.

q)(cor). (0 0 0 1 2 3 4;5 6 7 8 9 0 3)

-0.5407765

alternatively use prefix form

q).[cor;(0 0 0 1 2 3 4;5 6 7 8 9 0 3)]

-0.5407765

Jason 

Gotcha.  Thank you.

Much appreciated,

Victor