How to change namespace by parameter in KDB+

382 Views Asked by At

I want to change namespace by a given parameter something like below:

f:{system "d x"}

but this failed, .i.e

q)f[".new"]

{system "d x"}

'"

@

.,["\\"]

"d x"

How can I do this?

Thanks.

1

There are 1 best solutions below

0
On

You need to concatenate the function param x to your system call using join ,

i.e.

q)f:{system "d ",x}

q).ns.v:1
q)f[".ns"]
q.ns)v
1