7

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

Rahul
  • 3,914
  • 1
  • 14
  • 25
Martin Mlostek
  • 2,755
  • 1
  • 28
  • 57

1 Answers1

8

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

Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
Rahul
  • 3,914
  • 1
  • 14
  • 25