manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Internal Name Management,  Next: Namespace Example,  Prev: Naming Rules,  Up: Namespaces

15.6 Internal Name Management
=============================

For backwards compatibility, all identifiers in the 'awk' namespace are
stored internally as unadorned identifiers (that is, without a leading
'awk::').  This is mainly relevant when using such identifiers as
indices for 'SYMTAB', 'FUNCTAB', and 'PROCINFO["identifiers"]' (*note
Auto-set::), and for use in indirect function calls (*note Indirect
Calls::).

   In program code, to refer to variables and functions in the 'awk'
namespace from another namespace, you must still use the 'awk::' prefix.
For example:

     @namespace "awk"          This is the default namespace

     BEGIN {
         Title = "My Report"   Qualified name is awk::Title
     }

     @namespace "report"       Now in report namespace

     function compute()        This is really report::compute()
     {
         print awk::Title      But would be SYMTAB["Title"]
         ...
     }

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.