2022.07.09 10:53 AM
Dear All,
Could you please help me explain the meaning (3#,:)
I understand "3#" is taking 3 elements and "," is to join
but don't understand the ":" here.
and don't understand the meaning of (3#,:)
q)z
"abcde"
"fghij"
q)(3#,:)z
"abcde" "fghij"
"abcde" "fghij"
"abcde" "fghij"
2022.07.09 11:06 AM
I just found ,: means Amend At.
but still a little difficult to understand the result
2022.07.09 11:23 AM
I've understood the problem:)
but I cannot recall my post, sorry if bother you.
2022.07.10 12:50 AM - edited 2022.07.10 12:54 AM
This is implicit composition ('). You can see this from the parse tree:
q)parse "(3#,:)"
'
(#;3)
,:
In k, the expression ,: corresponds to enlist. This construct is the same as repetition (*) in Python.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.