KX Community

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

Home Forums KX Academy What is the purpose of the underscore in this line of u.q

  • What is the purpose of the underscore in this line of u.q

    Posted by mannix on March 13, 2022 at 12:00 am

    In the u.q file of the following set up, what is the purpose of the underscore here, (It doesnt appear to me to be cut or drop)

    del:{w[x]_:w[x;;0]?y};.z.pc:{del[;x]each t};

    mannix replied 8 months, 3 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • pmallon

    Member
    March 13, 2022 at 12:00 am

    Hi,

    it is drop in place to modify the dictionary w of table subscriptions. It is checking the list of subs for table x, for handle y, if there is an item its dropped from the list and w[x] is updated.

    section at the bottom here on drop in place:

    Drop in place

    Assign through Drop to delete in place.

    q)show d:`a`b`c`x!(1;2 3;4;5) 
    
    a| 1 
    b| 2 3 
    c| 4 
    x| 5 
    
    q)d _:`x 
    q)d 
    a| 1 
    b| 2 3 
    c| 4

    Hope that helps, if not let me know.

     

Log in to reply.