Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KDB+ / Q Accessing root namespace from namespace

how can I access functions/variables in the root namespace once I jumped into another namespace.

Example like this:

q)\d .cfg
q)domIV:1000
q)\d .
q)n:1000

And then later on I know how to access the variable domIV from the other namespace, but I dont know how to access the variable n from there:

q)\d .seed
q).cfg.domIV / works
q)n          / does not work
q).n         / does also not work

How can I access the root namespace?

Thanks

like image 475
Martin Mlostek Avatar asked Jun 07 '15 07:06

Martin Mlostek


1 Answers

Context (namespace) is just a dictionary so you can use dictionary syntax.

      q)  \d .seed
      q.seed)   `.[`n]

Reference: http://code.kx.com/q4m3/12_Workspace_Organization/

Check section: A Context is a Dictionary

like image 67
Rahul Avatar answered Sep 30 '22 16:09

Rahul