Please help me with colon :
operator, I'm stuck on how it works. It works as an assignment, assignment through x+:1
, global assignment/view ::
, I/O 0:
, 1:
, to return value from the middle of the function :r
, and to get an unary form of operator #:
.
But what happend if one apply an adverb to it? I tried this way:
$ q
KDB+ 3.6 2019.04.02 Copyright (C) 1993-2019 Kx Systems
q)(+')[100;2 3 4]
102 103 104
q)(:')[x;2 3 4]
'x
[0] (:')[x;2 3 4]
^
q)(:')[100;2 3 4]
2 3 4
I expect evaluations in order: x:2
, then x:3
, then x:4
. To get x:4
as a result. But I've got an error. And also :'
works with a number 100
for some unknown reason.
What :'
is actually doing?
q)parse "(:')[100;2 3 4]"
(';:)
100
2 3 4
Parsing didn't shed much light to me, so I'm asking for your help.