Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to understand the definition of an atomic function quoted here: .[f;x]~.[f';x]

Now I believe the . is function application as documented here, but what is f' in the above ?

question from:https://stackoverflow.com/questions/65517610/kdb-q-how-to-understand-the-definitions-in-the-language-reference

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
260 views
Welcome To Ask or Share your Answers For Others

1 Answer

The statement is saying that the two are equivalent and that using each is not required in an atomic function i.e. .[f;x] is essentially .[f';x]

You can see this in the example given here where + is f and (2;(3 4;5)) x https://code.kx.com/q/basics/atomic/

q).[+;(2;(3 4;5))]
5 6
7
q).[+';(2;(3 4;5))]   / the iterator is unnecessary
5 6
7

where the function + is applied to each item in the nested list using the atomic function


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...