apldyalog

How do you find the name of the current namespace


I have been reading a lot about namespaces and there is one thing I cannot figure out. How do you get the name of the current namespace in Dyalog APL, similar to "pwd" in linux?

I would like to get the current NS programmatically in a function and on the command line.


Solution

  • ⎕THIS

    That said, it actually returns a reference to the current namespace. If you want the name in text form, then use ⍕⎕THIS, but note that a namespace can be unnamed, in which case you might get something useless like '#.[Namespace]'.