Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

q - Application by name

Tags:

q-lang

kdb+

In the q for mortals chapter on functions there is a little paragraph on "Application by name":

q)f:{x*x}
q)f[5]
_
q)`f[5]
25
q)`f 5
_
q).my.name.space.f:{2*x}
q)`.my.name.space.f[5]

I don't understand where and why this would be used.

Thanks for the help

like image 453
tenticon Avatar asked Jun 14 '26 14:06

tenticon


1 Answers

If we needed to call a function on a remote q server, and all we had was its name, then we could write

h (`.my.ns.function;x;y)

and receive a result - all with a symbol reference.

like image 125
effbiae Avatar answered Jun 18 '26 00:06

effbiae



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!