admin管理员组文章数量:1026989
I understand (count 1 2 3,)
is a composition, because I see its type is 105.
q)type(count 5 6,)
105h
Initially I thought this is an example of implicit composition, which
Compose one or more unary values with a higher-rank value
I thought the values are
- unary:
count
- unary:
1 2 3
- binary:
,
(join)
However, I don't think that's correct because ,
(join operator) has rank 2, but the result of the composition only has rank 1. This goes against what I read, i.e. result of composition should have the same rank as the last value.
Could someone help explain how exactly this composition works?
I suspect the "composed values" are instead
- unary:
count
- unary:
1 2 3,
If this is the case, doesn't composing a series of unary values require an @
(apply at) as stated at the bottom of this page?
I understand (count 1 2 3,)
is a composition, because I see its type is 105.
q)type(count 5 6,)
105h
Initially I thought this is an example of implicit composition, which
Compose one or more unary values with a higher-rank value
I thought the values are
- unary:
count
- unary:
1 2 3
- binary:
,
(join)
However, I don't think that's correct because ,
(join operator) has rank 2, but the result of the composition only has rank 1. This goes against what I read, i.e. result of composition should have the same rank as the last value.
Could someone help explain how exactly this composition works?
I suspect the "composed values" are instead
- unary:
count
- unary:
1 2 3,
If this is the case, doesn't composing a series of unary values require an @
(apply at) as stated at the bottom of this page?
1 Answer
Reset to default 3It is implicit composition but is created in a different order giving a different outcome.
The example from the site:
0|+
isnoun rank2 rank2
This example binds the noun
to the rank2
to it's right leaving the trailing rank2
giving the rank of the whole composition as 2
.
Your example:
count 5 6,
isrank1 noun rank2
This example again binds the noun
to rank2
to it's right which drops it to rank 1
before composing
- https://code.kx.com/q/basics/syntax/#prefix-infix-postfix
- https://code.kx.com/q/basics/syntax/#nouns
I understand (count 1 2 3,)
is a composition, because I see its type is 105.
q)type(count 5 6,)
105h
Initially I thought this is an example of implicit composition, which
Compose one or more unary values with a higher-rank value
I thought the values are
- unary:
count
- unary:
1 2 3
- binary:
,
(join)
However, I don't think that's correct because ,
(join operator) has rank 2, but the result of the composition only has rank 1. This goes against what I read, i.e. result of composition should have the same rank as the last value.
Could someone help explain how exactly this composition works?
I suspect the "composed values" are instead
- unary:
count
- unary:
1 2 3,
If this is the case, doesn't composing a series of unary values require an @
(apply at) as stated at the bottom of this page?
I understand (count 1 2 3,)
is a composition, because I see its type is 105.
q)type(count 5 6,)
105h
Initially I thought this is an example of implicit composition, which
Compose one or more unary values with a higher-rank value
I thought the values are
- unary:
count
- unary:
1 2 3
- binary:
,
(join)
However, I don't think that's correct because ,
(join operator) has rank 2, but the result of the composition only has rank 1. This goes against what I read, i.e. result of composition should have the same rank as the last value.
Could someone help explain how exactly this composition works?
I suspect the "composed values" are instead
- unary:
count
- unary:
1 2 3,
If this is the case, doesn't composing a series of unary values require an @
(apply at) as stated at the bottom of this page?
1 Answer
Reset to default 3It is implicit composition but is created in a different order giving a different outcome.
The example from the site:
0|+
isnoun rank2 rank2
This example binds the noun
to the rank2
to it's right leaving the trailing rank2
giving the rank of the whole composition as 2
.
Your example:
count 5 6,
isrank1 noun rank2
This example again binds the noun
to rank2
to it's right which drops it to rank 1
before composing
- https://code.kx.com/q/basics/syntax/#prefix-infix-postfix
- https://code.kx.com/q/basics/syntax/#nouns
本文标签: kdbWhat type of composition is (count 1 2 3)Stack Overflow
版权声明:本文标题:kdb+ - What type of composition is (count 1 2 3,) - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1736214068a1393878.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论