KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Struggling to understand two statements

  • Struggling to understand two statements

    Posted by Laura on November 11, 2021 at 12:00 am

    I am studying the official example code from here: https://github.com/kxcontrib/websocket/blob/master/AppendixB/pubsub.q and after thinking for a while I still don’t understand what exactly a few lines do:

     

    trade:flip `time`sym`price`size!"nsfi"$:(); 
    subs:2!flip `handle`func`params!"is*"$:();

     

    The following is the things I already know:

    1. Q generally read from right to left;
    2. We assign the results to trade/subs;
    3. flip is used to transpose an input
    4. `time `sym are “symbols”
    5. “nsfi” is used to specify the type of columns

    Then here comes the things I don’t know…

    1. What does $:() do?
    2. How about the bang between symbols and “nsfi”?
    3. What does 2!flip mean?..

     

    Thanks!

    Laura replied 9 months, 1 week ago 2 Members · 3 Replies
  • 3 Replies

Log in to reply.