cancel
Showing results for 
Search instead for 
Did you mean: 

How to understand the meaning of (3#,:)

Danielhk
New Contributor II

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"

3 REPLIES 3

Danielhk
New Contributor II

I just found ,: means  Amend At.

but still a little difficult to understand the result

Danielhk
New Contributor II

I've understood the problem:)

but I cannot recall my post, sorry if bother you.

fbodon
New Contributor II
New Contributor II

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. 

See: https://code.kx.com/q/ref/compose/