KX Community

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

Home Forums kdb+ Can someone clarify implicit composition here ?

  • megan_mcp

    Administrator
    June 11, 2024 at 10:56 am

    Hi @newstudent2017

    In the documentation it states the derived function ‘[f;ff] has the rank of ff and returns f ff[x;y;z]

    If we use the following examples:

    q)ff:{[w;x;y;z]w+x+y+z}

    q)ff[1;2;3;4]

    10

    If the syntax returns f ff[x;y;z] then essentially the result for ff[w;x;y;z] is our x parameter for f.

    We know that ff[1;2;3;4] = 10

    q)f:{2*x}

    q)f[10]

    20

    We use composition to combine these steps together:

    q)'[f;ff][1;2;3;4]

    20

    If you have any questions about this, please let me know!

    Thanks,

    Megan

Log in to reply.