Namespaces are containers within the kdb+ workspace. Names defined in a namespace are unique only within the namespace.
Namespaces are a convenient way to divide an application between modules; also to construct and share library code.
Namespaces are identified by a leading dot in their names.
Kdb+ includes the following namespaces.
||Functions for converting files into various formats and for web-console display|
||Functions for converting between JSON and q dictionaries|
||Objects in memry domain 1|
||Definitions of q keywords|
||System variables and functions, and hooks for callbacks|
The linked pages document some of the objects in these namespaces. (Undocumented objects are part of the namespace infrastructure and should not be used in kdb+ applications.)
These and all single-character namespaces are reserved for use by KX.
Apart from the leading dot, namespace names follow the same rules as names for q objects.
Outside its containing namespace, an object is known by the full name of its containing namespace followed by a dot and its own name.
Namespaces can contain other namespaces.
.fee.fi.fo is the name of object
fo within namespace
fi within namespace
Namespaces are implemented as dictionaries.
To list the objects contained in namespace
To list all the namespaces in the root:
Referring to a namespace is sufficient to create it.
q)key ` `q`Q`h`j`o q).fee.fi.fo:42 q)key ` `q`Q`h`j`o`fee q)key `.fee ``fi q)key `.fee.fi ``fo