gawk Features ¶This section looks briefly at how the namespace facility interacts
with other important gawk features.
The profiler and pretty-printer (see Profiling Your awk Programs)
understand namespaces and the namespace naming rules presented in
Namespace and Component Naming Rules. In particular, the output groups functions in the same
namespace together, and has @namespace directives in front
of rules as necessary. This allows component names to be
simple identifiers, instead of using qualified identifiers everywhere.
Functions in the "awk" namespace are printed first,
followed by functions in namespaces, sorted by namespace name.
Interaction with the debugger (see Introduction to the gawk Debugger) has not had to change
(at least as of this writing). Some of the internal byte codes changed
in order to accommodate namespaces, and the debugger’s dump command
was adjusted to match.
The extension API (see Writing Extensions for gawk) allows for
placing functions into a different namespace, and
the symbol lookup and symbol update
routines have provision for including a namespace.
(see Variable Access and Update by Name).
See Enabling In-Place File Editing, for a nice example of an extension that
leverages a namespace shared by cooperating awk and C code.