[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-2640-g18f6277 |
Date: |
Wed, 19 Jul 2017 14:34:19 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/namespaces has been updated
via 18f627717a1799d564711e1ac103904e4100072c (commit)
from 07e4003f9cf877c64bf3aee2829a1c80b3ab0a10 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=18f627717a1799d564711e1ac103904e4100072c
commit 18f627717a1799d564711e1ac103904e4100072c
Author: Arnold D. Robbins <address@hidden>
Date: Wed Jul 19 21:33:59 2017 +0300
More work on namespace doc, including naming rules.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 37d64c5..15c17ff 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-19 Arnold D. Robbins <address@hidden>
+
+ * gawktexi.in (Namespaces): Cleanup, new section on naming rules
+ added.
+
2017-07-17 Arnold D. Robbins <address@hidden>
* gawktexi.in (Namespaces): Revised password suite example.
diff --git a/doc/gawk.info b/doc/gawk.info
index aa1ebd3..98d7930 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -527,6 +527,8 @@ in (a) below. A copy of the license is included in the
section entitled
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
+* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
* Computer Arithmetic:: A quick intro to computer math.
@@ -1104,6 +1106,10 @@ in *note Sample Programs::, should be of interest.
- *note Debugger::, describes the 'gawk' debugger.
+ - *note Namespaces::, describes how 'gawk' allows variables
+ and/or functions of the same name to be in different
+ namespaces.
+
- *note Arbitrary Precision Arithmetic::, describes advanced
arithmetic facilities.
@@ -2479,6 +2485,9 @@ The following list describes options mandated by the
POSIX standard:
the 'awk' program consists of the concatenation of the contents of
each specified SOURCE-FILE.
+ Files named with '-i' are treated as if they had '@namespace "awk"'
+ at their beginning. *Note Namespaces::, for more information.
+
'-v VAR=VAL'
'--assign VAR=VAL'
Set the variable VAR to the value VAL _before_ execution of the
@@ -2585,6 +2594,10 @@ The following list describes options mandated by the
POSIX standard:
However, this is no longer true. If you have any scripts that
rely upon this feature, you should revise them.
+ This is because each PROGRAM-TEXT is treated as if it had
+ '@namespace "awk"' at its beginning. *Note Namespaces::, for
+ more information.
+
'-E' FILE
'--exec' FILE
Similar to '-f', read 'awk' program text from FILE. There are two
@@ -2632,6 +2645,9 @@ The following list describes options mandated by the
POSIX standard:
processing an '-i' argument, 'gawk' still expects to find the main
source code via the '-f' option or on the command line.
+ Files named with '-i' are treated as if they had '@namespace "awk"'
+ at their beginning. *Note Namespaces::, for more information.
+
'-l' EXT
'--load' EXT
Load a dynamic extension named EXT. Extensions are stored as
@@ -3250,6 +3266,10 @@ from web pages.
always searched first for source files, before searching in 'AWKPATH';
this also applies to files named with '@include'.
+ Finally, files included with '@include' are treated as if they had
+'@namespace "awk"' at their beginning. *Note Namespaces::, for more
+information.
+
File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev:
Include Files, Up: Invoking Gawk
@@ -22505,6 +22525,7 @@ This major node describes a feature that is specific to
'gawk'.
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
@@ -22534,8 +22555,8 @@ are much fewer namespaces in use by any given program,
and thus much
less chance for collisions.) These facilities are sometimes referred to
as "packages" or "modules".
- Starting with version *FIXME* 5.0, 'gawk' provides a mechanism to put
-functions and global variables into separate namespaces.
+ Starting with version *FIXME* 5.0, 'gawk' provides a simple mechanism
+to put functions and global variables into separate namespaces.
File: gawk.info, Node: Qualified Names, Next: Default Namespace, Prev:
Global Namespace, Up: Namespaces
@@ -22543,36 +22564,21 @@ File: gawk.info, Node: Qualified Names, Next:
Default Namespace, Prev: Global
15.2 Qualified Names
====================
-A "qualified name" is an identifier that includes a namespace name and
-the namespace separator, '::'. For example, one might have a function
-named 'posix::getpid()'. Here, the namespace is 'posix' and the
-function name within the namespace is 'getpid()'. The namespace and
-variable or function name are separated by a double-colon. Only one
-such separator is allowed in a qualified name.
+A "qualified name" is an identifier that includes a namespace name, the
+namespace separator '::', and a component name. For example, one might
+have a function named 'posix::getpid()'. Here, the namespace is 'posix'
+and the function name within the namespace (the component) is
+'getpid()'. The namespace and component names are separated by a
+double-colon. Only one such separator is allowed in a qualified name.
NOTE: Unlike C++, the '::' is _not_ an operator. No spaces are
- allowed between the namespace name, the '::', and the rest of the
+ allowed between the namespace name, the '::', and the component
name.
- You must use fully qualified names from one namespace to access
-variables and functions in another. This is especially important when
-using variable names to index the special 'SYMTAB' array (*note
-Auto-set::), and when making indirect function calls (*note Indirect
-Calls::).
-
- It is a fatal error to use any 'gawk' reserved word (such as 'if' or
-'for'), or the name of any built-in function (such as 'sin()' or
-'gsub()') as either part of a fully qualified name.(1)
-
- 'gawk' pre-defined variable names may be used: 'NF::NR' is valid, if
-possibly not all that useful.
-
- ---------- Footnotes ----------
-
- (1) We hope to improve the implementation so that this restriction
-will apply only to standard 'awk' reserved words and built-in functions.
-In this case, the additional built-in functions defined by 'gawk' will
-become pre-loaded extension functions.
+ You must use qualified names from one namespace to access variables
+and functions in another. This is especially important when using
+variable names to index the special 'SYMTAB' array (*note Auto-set::),
+and when making indirect function calls (*note Indirect Calls::).
File: gawk.info, Node: Default Namespace, Next: Changing The Namespace,
Prev: Qualified Names, Up: Namespaces
@@ -22588,13 +22594,11 @@ have qualified names like 'awk::ARGC', 'awk::NF', and
so on.
current source file (*note Changing The Namespace::), 'gawk' forces
unqualified identifiers whose names are all uppercase letters to be in
the 'awk' namespace. This makes it possible for you to easily reference
-'gawk''s global variables from different namespaces.
-
- It is a syntax error to use qualified names for function parameter
-names.
+'gawk''s global variables from different namespaces. It also keeps your
+code looking natural.
-File: gawk.info, Node: Changing The Namespace, Next: Internal Name
Management, Prev: Default Namespace, Up: Namespaces
+File: gawk.info, Node: Changing The Namespace, Next: Naming Rules, Prev:
Default Namespace, Up: Namespaces
15.4 Changing The Namespace
===========================
@@ -22614,28 +22618,92 @@ are placed into the 'passwd' namespace.
file, although this is likely to become confusing if you do it too much.
NOTE: Association of unqualified identifiers to a namespace is
- handled while your program is being parsed by 'gawk' and before it
- starts to run. There is no concept of a "current" namespace once
- your program starts executing. Be sure you understand this.
+ handled while 'gawk' parses your program, before it starts to run.
+ There is no concept of a "current" namespace once your program
+ starts executing. Be sure you understand this.
Each source file for '-i' and '-f' starts out with an implicit
'@namespace "awk"'. Similarly, each chunk of command-line code supplied
with '-e' has such an implicit initial statement (*note Options::).
+ Files included with '@include' (*note Include Files::) "push" and
+"pop" the current namespace. That is, each '@include' saves the current
+namespace and starts over with an implicit '@namespace "awk"' until an
+explicit '@namespace' statement is seen. When 'gawk' finishes
+processing the included file, the saved namespace is restored and
+processing continues where it left off in the original file.
+
The use of '@namespace' has no influence upon the order of execution
of 'BEGIN', 'BEGINFILE', 'END', and 'ENDFILE' rules.
-File: gawk.info, Node: Internal Name Management, Next: Namespace Example,
Prev: Changing The Namespace, Up: Namespaces
+File: gawk.info, Node: Naming Rules, Next: Internal Name Management, Prev:
Changing The Namespace, Up: Namespaces
+
+15.5 Namespace and Component Naming Rules
+=========================================
+
+A number of rules apply to the namespace and component names, as
+follows.
+
+ * It is a syntax error to use qualified names for function parameter
+ names.
+
+ * It is a syntax error to use any standard 'awk' reserved word (such
+ as 'if' or 'for'), or the name of any standard built-in function
+ (such as 'sin()' or 'gsub()') as either part of a qualified name.
+ Thus, the following produces a syntax error:
+
+ @namespace "example"
+
+ function gsub(str, pat, result) { ... }
+
+ * Outside the 'awk' namespace, the names of the additional 'gawk'
+ built-in functions (such as 'gensub()' or 'strftime()') _may_ be
+ used as a component name. The same set of names may be used as
+ namespace names, although this has the potential to be confusing.
+
+ * The additional 'gawk' built-in functions may still be called from
+ outside the 'awk' namespace by qualifying them. For example,
+ 'awk::systime()'. Here is a somewhat silly example demonstrating
+ this rule and the previous one:
+
+ BEGIN {
+ print "in awk namespace, systime() =", systime()
+ }
+
+ @namespace "testing"
+
+ function systime()
+ {
+ print "in testing namespace, systime() =", awk::systime()
+ }
+
+ BEGIN {
+ systime()
+ }
+
+
+ When run, it produces output like this:
+
+ $ gawk -f systime.awk
+ -| in awk namespace, systime() = 1500488503
+ -| in testing namespace, systime() = 1500488503
+
+ * 'gawk' pre-defined variable names may be used: 'NF::NR' is valid,
+ if possibly not all that useful.
+
+
+File: gawk.info, Node: Internal Name Management, Next: Namespace Example,
Prev: Naming Rules, Up: Namespaces
-15.5 Internal Name Management
+15.6 Internal Name Management
=============================
For backwards compatibility, all identifiers in the 'awk' namespace are
-stored internally as unadorned identifiers. 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::).
+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.
@@ -22644,7 +22712,7 @@ For example:
@namespace "awk" This is the default namespace
BEGIN {
- Title = "My Report" Fully qualified name is awk::Title
+ Title = "My Report" Qualified name is awk::Title
}
@namespace "report" Now in report namespace
@@ -22658,16 +22726,17 @@ For example:
File: gawk.info, Node: Namespace Example, Next: Namespace Misc, Prev:
Internal Name Management, Up: Namespaces
-15.6 Namespace Example
+15.7 Namespace Example
======================
The following example is a revised version of the suite of routines
-developed in *note Passwd Functions::.
+developed in *note Passwd Functions::. See there for an explanation of
+how the code works.
The formulation here, due mainly to Andrew Schorr, is rather elegant.
-It places all of the implementation functions and variables in the
-'passwd' namespace, while leaving the main interface functions in the
-default 'awk' namespace.
+All of the implementation functions and variables are in the 'passwd'
+namespace, whereas the main interface functions are defined in the 'awk'
+namespace.
# ns_passwd.awk --- access password file information
@@ -22738,13 +22807,32 @@ default 'awk' namespace.
*note Library Names::, whereby global variable and function names start
with a capital letter.
+ Here is a simple test program:
+
+ BEGIN {
+ while ((p = getpwent()) != "")
+ print p
+ }
+
+
+ Here's what happens when it's run:
+
+ $ gawk -f ns_passwd.awk -f testpasswd.awk
+ -| root:x:0:0:root:/root:/bin/bash
+ -| daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
+ -| bin:x:2:2:bin:/bin:/usr/sbin/nologin
+ -| sys:x:3:3:sys:/dev:/usr/sbin/nologin
+ ...
+
File: gawk.info, Node: Namespace Misc, Prev: Namespace Example, Up:
Namespaces
-15.7 Miscellaneous Notes
+15.8 Miscellaneous Notes
========================
-Other notes for reviewers:
+*FIXME*: Finish revising this material.
+
+ Other notes for reviewers:
Profiler:
When profiling, we include the namespace in the 'Op_Rule' and
@@ -22759,11 +22847,6 @@ Debugger:
will use that to create fully qualified names? Have to be careful
about all uppercase names though.
-How does this affect '@include'?
- Basically '@include' should push and pop the namespace. Each
- '@include' saves the current namespace and starts over with
- namespace 'awk' until an '@namespace' is seen (DONE).
-
Extension functions
Revise the current macros to pass '"awk"' as the namespace argument
and add new macros with '_ns' in the name that pass the namespace
@@ -22799,40 +22882,6 @@ More on Extension Functions
be made to point to something? What would be carry around in
it?
-Additional 'gawk' built-ins
- Based on some discussion with Andrew Schorr, I'd like to find a way
- to change the additional 'gawk' built-in functions, like
- 'gensub()', 'strftime()', etc. into "pre-defined" extension
- functions in the 'awk' namespace. This has some advantages:
-
- 1. It gives us room to add more built-ins without they're being
- reserved words to the grammar. This in turn means that:
-
- 2. Users can define their own functions with the same name as
- 'gawk' additions as long as they put them in their own
- namespace.
-
- Everybody wins!
-
- Note that POSIX-standard pre-defined 'awk' names such as 'length()'
- and 'sub()' would remain reserved. The following would produce a
- syntax error:
-
- @namespace "example"
-
- function gsub(str, pat, result) { ... }
-
- Whereas this would not:
-
- @namespace "example"
-
- function gensub(str, pat, result) { ... }
-
- One challenge is the 'snode()' function in 'awkgram.y' which does
- certain "fix-ups" for calls to certain built-in functions,
- including some of the additional 'gawk'-specific ones. I still
- think this is all doable, but it will take some thought.
-
File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic
Extensions, Prev: Namespaces, Up: Top
@@ -33058,13 +33107,13 @@ Index
* - (hyphen), -- operator <1>: Precedence. (line 45)
* - (hyphen), -= operator: Assignment Ops. (line 129)
* - (hyphen), -= operator <1>: Precedence. (line 94)
-* - (hyphen), filenames beginning with: Options. (line 60)
+* - (hyphen), filenames beginning with: Options. (line 63)
* - (hyphen), in bracket expressions: Bracket Expressions. (line 25)
-* --assign option: Options. (line 32)
-* --bignum option: Options. (line 217)
-* --characters-as-bytes option: Options. (line 69)
-* --copyright option: Options. (line 89)
-* --debug option: Options. (line 108)
+* --assign option: Options. (line 35)
+* --bignum option: Options. (line 227)
+* --characters-as-bytes option: Options. (line 72)
+* --copyright option: Options. (line 92)
+* --debug option: Options. (line 111)
* --disable-extensions configuration option: Additional Configuration Options.
(line 9)
* --disable-lint configuration option: Additional Configuration Options.
@@ -33073,81 +33122,81 @@ Index
(line 32)
* --disable-nls configuration option: Additional Configuration Options.
(line 37)
-* --dump-variables option: Options. (line 94)
+* --dump-variables option: Options. (line 97)
* --dump-variables option, using for library functions: Library Names.
(line 45)
-* --exec option: Options. (line 139)
+* --exec option: Options. (line 146)
* --field-separator option: Options. (line 21)
* --file option: Options. (line 25)
-* --gen-pot option: Options. (line 161)
+* --gen-pot option: Options. (line 168)
* --gen-pot option <1>: String Extraction. (line 6)
* --gen-pot option <2>: String Extraction. (line 6)
-* --help option: Options. (line 168)
-* --include option: Options. (line 173)
+* --help option: Options. (line 175)
+* --include option: Options. (line 180)
* --lint option: Command Line. (line 20)
-* --lint option <1>: Options. (line 198)
-* --lint-old option: Options. (line 313)
-* --load option: Options. (line 186)
-* --no-optimize option: Options. (line 299)
-* --non-decimal-data option: Options. (line 223)
+* --lint option <1>: Options. (line 208)
+* --lint-old option: Options. (line 323)
+* --load option: Options. (line 196)
+* --no-optimize option: Options. (line 309)
+* --non-decimal-data option: Options. (line 233)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 35)
-* --optimize option: Options. (line 248)
-* --posix option: Options. (line 271)
-* --posix option, --traditional option and: Options. (line 286)
-* --pretty-print option: Options. (line 237)
-* --profile option: Options. (line 259)
+* --optimize option: Options. (line 258)
+* --posix option: Options. (line 281)
+* --posix option, --traditional option and: Options. (line 296)
+* --pretty-print option: Options. (line 247)
+* --profile option: Options. (line 269)
* --profile option <1>: Profiling. (line 12)
-* --re-interval option: Options. (line 292)
-* --sandbox option: Options. (line 304)
+* --re-interval option: Options. (line 302)
+* --sandbox option: Options. (line 314)
* --sandbox option, disabling system() function: I/O Functions.
(line 129)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
-* --source option: Options. (line 117)
-* --traditional option: Options. (line 82)
-* --traditional option, --posix option and: Options. (line 286)
-* --use-lc-numeric option: Options. (line 232)
-* --version option: Options. (line 318)
+* --source option: Options. (line 120)
+* --traditional option: Options. (line 85)
+* --traditional option, --posix option and: Options. (line 296)
+* --use-lc-numeric option: Options. (line 242)
+* --version option: Options. (line 328)
* --with-whiny-user-strftime configuration option: Additional Configuration
Options.
(line 42)
-* -b option: Options. (line 69)
-* -c option: Options. (line 82)
-* -C option: Options. (line 89)
-* -d option: Options. (line 94)
-* -D option: Options. (line 108)
-* -e option: Options. (line 117)
-* -E option: Options. (line 139)
-* -e option <1>: Options. (line 354)
+* -b option: Options. (line 72)
+* -c option: Options. (line 85)
+* -C option: Options. (line 92)
+* -d option: Options. (line 97)
+* -D option: Options. (line 111)
+* -e option: Options. (line 120)
+* -E option: Options. (line 146)
+* -e option <1>: Options. (line 364)
* -f option: Long. (line 12)
* -F option: Options. (line 21)
* -f option <1>: Options. (line 25)
-* -F option, -Ft sets FS to TAB: Options. (line 326)
+* -F option, -Ft sets FS to TAB: Options. (line 336)
* -F option, command-line: Command Line Field Separator.
(line 6)
-* -f option, multiple uses: Options. (line 331)
-* -g option: Options. (line 161)
-* -h option: Options. (line 168)
-* -i option: Options. (line 173)
-* -l option: Options. (line 186)
-* -l option <1>: Options. (line 198)
-* -L option: Options. (line 313)
-* -M option: Options. (line 217)
-* -n option: Options. (line 223)
-* -N option: Options. (line 232)
-* -o option: Options. (line 237)
-* -O option: Options. (line 248)
-* -p option: Options. (line 259)
-* -P option: Options. (line 271)
-* -r option: Options. (line 292)
-* -s option: Options. (line 299)
-* -S option: Options. (line 304)
-* -v option: Options. (line 32)
-* -V option: Options. (line 318)
+* -f option, multiple uses: Options. (line 341)
+* -g option: Options. (line 168)
+* -h option: Options. (line 175)
+* -i option: Options. (line 180)
+* -l option: Options. (line 196)
+* -l option <1>: Options. (line 208)
+* -L option: Options. (line 323)
+* -M option: Options. (line 227)
+* -n option: Options. (line 233)
+* -N option: Options. (line 242)
+* -o option: Options. (line 247)
+* -O option: Options. (line 258)
+* -p option: Options. (line 269)
+* -P option: Options. (line 281)
+* -r option: Options. (line 302)
+* -s option: Options. (line 309)
+* -S option: Options. (line 314)
+* -v option: Options. (line 35)
+* -V option: Options. (line 328)
* -v option <1>: Assignment Options. (line 12)
-* -W option: Options. (line 47)
+* -W option: Options. (line 50)
* . (period), regexp operator: Regexp Operators. (line 44)
* .gmo files: Explaining gettext. (line 42)
* .gmo files, specifying directory of: Explaining gettext. (line 54)
@@ -33442,9 +33491,9 @@ Index
* atan2: Numeric Functions. (line 12)
* automatic displays, in debugger: Debugger Info. (line 24)
* awf (amazingly workable formatter) program: Glossary. (line 24)
-* awk debugging, enabling: Options. (line 108)
+* awk debugging, enabling: Options. (line 111)
* awk language, POSIX version: Assignment Ops. (line 138)
-* awk profiling, enabling: Options. (line 259)
+* awk profiling, enabling: Options. (line 269)
* awk programs: Getting Started. (line 12)
* awk programs <1>: Executable Scripts. (line 6)
* awk programs <2>: Two Rules. (line 6)
@@ -33458,8 +33507,8 @@ Index
* awk programs, lengthy: Long. (line 6)
* awk programs, lengthy, assertions: Assert Function. (line 6)
* awk programs, location of: Options. (line 25)
-* awk programs, location of <1>: Options. (line 139)
-* awk programs, location of <2>: Options. (line 173)
+* awk programs, location of <1>: Options. (line 146)
+* awk programs, location of <2>: Options. (line 180)
* awk programs, one-line examples: Very Simple. (line 46)
* awk programs, profiling: Profiling. (line 6)
* awk programs, running: Running gawk. (line 6)
@@ -33501,7 +33550,7 @@ Index
* AWKPATH environment variable <1>: PC Using. (line 9)
* awkprof.out file: Profiling. (line 6)
* awksed.awk program: Simple Sed. (line 25)
-* awkvars.out file: Options. (line 94)
+* awkvars.out file: Options. (line 97)
* b debugger command (alias for break): Breakpoint Control. (line 11)
* backslash (\): Comments. (line 50)
* backslash (\), as field separator: Command Line Field Separator.
@@ -33702,7 +33751,7 @@ Index
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
-* CGI, awk scripts for: Options. (line 139)
+* CGI, awk scripts for: Options. (line 146)
* character classes, See bracket expressions: Regexp Operators.
(line 56)
* character lists in regular expression: Bracket Expressions. (line 6)
@@ -33760,7 +33809,7 @@ Index
* command line, invoking awk from: Command Line. (line 6)
* command line, option -f: Long. (line 12)
* command line, options: Options. (line 6)
-* command line, options, end of: Options. (line 55)
+* command line, options, end of: Options. (line 58)
* command line, variables, assigning on: Assignment Options. (line 6)
* command-line options, processing: Getopt Function. (line 6)
* command-line options, string extraction: String Extraction. (line 6)
@@ -33796,7 +33845,7 @@ Index
(line 59)
* compatibility mode (gawk), octal numbers: Nondecimal-numbers.
(line 59)
-* compatibility mode (gawk), specifying: Options. (line 82)
+* compatibility mode (gawk), specifying: Options. (line 85)
* compiled programs: Basic High Level. (line 13)
* compiled programs <1>: Glossary. (line 218)
* compiling gawk for Cygwin: Cygwin. (line 6)
@@ -33854,7 +33903,7 @@ Index
* cosine: Numeric Functions. (line 16)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 43)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 372)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 382)
* csh utility, |& operator, comparison with: Two-way I/O. (line 27)
* ctime() user-defined function: Function Example. (line 74)
* currency symbols, localization: Explaining gettext. (line 104)
@@ -34043,7 +34092,7 @@ Index
* debugger, read commands from a file: Debugger Info. (line 97)
* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 283)
+* decimal point character, locale specific: Options. (line 293)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott: Acknowledgments. (line 60)
@@ -34164,7 +34213,7 @@ Index
* down debugger command: Execution Stack. (line 23)
* Drepper, Ulrich: Acknowledgments. (line 52)
* Duman, Patrice: Acknowledgments. (line 75)
-* dump all variables of a program: Options. (line 94)
+* dump all variables of a program: Options. (line 97)
* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
* dupword.awk program: Dupword Program. (line 31)
@@ -34395,7 +34444,7 @@ Index
* files, /inet6/... (gawk): TCP/IP Networking. (line 6)
* files, awk programs in: Long. (line 6)
* files, awkprof.out: Profiling. (line 6)
-* files, awkvars.out: Options. (line 94)
+* files, awkvars.out: Options. (line 97)
* files, closing: I/O Functions. (line 10)
* files, descriptors, See file descriptors: Special FD. (line 6)
* files, group: Group Functions. (line 6)
@@ -34422,7 +34471,7 @@ Index
* files, portable object template: Explaining gettext. (line 31)
* files, portable object, converting to message object files: I18N Example.
(line 66)
-* files, portable object, generating: Options. (line 161)
+* files, portable object, generating: Options. (line 168)
* files, processing, ARGIND variable and: Auto-set. (line 50)
* files, reading: Rewind Function. (line 6)
* files, reading, multiline records: Multiple Line. (line 6)
@@ -34485,7 +34534,7 @@ Index
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
(line 20)
-* FS variable, as TAB character: Options. (line 280)
+* FS variable, as TAB character: Options. (line 290)
* FS variable, changing value of: Field Separators. (line 34)
* FS variable, running awk programs and: Cut Program. (line 63)
* FS variable, setting from command line: Command Line Field Separator.
@@ -34575,7 +34624,7 @@ Index
* gawk, ERRNO variable in <3>: Auto-set. (line 87)
* gawk, ERRNO variable in <4>: TCP/IP Networking. (line 54)
* gawk, escape sequences: Escape Sequences. (line 121)
-* gawk, extensions, disabling: Options. (line 271)
+* gawk, extensions, disabling: Options. (line 281)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, field separators and: User-modified. (line 74)
@@ -34637,7 +34686,7 @@ Index
* gawk, TEXTDOMAIN variable in: User-modified. (line 155)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
-* gawk, versions of, information about, printing: Options. (line 318)
+* gawk, versions of, information about, printing: Options. (line 328)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 66)
@@ -34716,7 +34765,7 @@ Index
* GNU Lesser General Public License: Glossary. (line 491)
* GNU long options: Command Line. (line 13)
* GNU long options <1>: Options. (line 6)
-* GNU long options, printing list of: Options. (line 168)
+* GNU long options, printing list of: Options. (line 175)
* GNU Project: Manual History. (line 11)
* GNU Project <1>: Glossary. (line 405)
* GNU/Linux: Manual History. (line 28)
@@ -34725,7 +34774,7 @@ Index
* Gordon, Assaf: Contributors. (line 106)
* GPL (General Public License): Manual History. (line 11)
* GPL (General Public License) <1>: Glossary. (line 396)
-* GPL (General Public License), printing: Options. (line 89)
+* GPL (General Public License), printing: Options. (line 92)
* grcat program: Group Functions. (line 16)
* Grigera, Juan: Contributors. (line 58)
* group database, reading: Group Functions. (line 6)
@@ -34748,7 +34797,7 @@ Index
* help debugger command: Miscellaneous Debugger Commands.
(line 69)
* hexadecimal numbers: Nondecimal-numbers. (line 6)
-* hexadecimal values, enabling interpretation of: Options. (line 223)
+* hexadecimal values, enabling interpretation of: Options. (line 233)
* history expansion, in debugger: Readline Support. (line 6)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
@@ -34759,7 +34808,7 @@ Index
* hyphen (-), -- operator <1>: Precedence. (line 45)
* hyphen (-), -= operator: Assignment Ops. (line 129)
* hyphen (-), -= operator <1>: Precedence. (line 94)
-* hyphen (-), filenames beginning with: Options. (line 60)
+* hyphen (-), filenames beginning with: Options. (line 63)
* hyphen (-), in bracket expressions: Bracket Expressions. (line 25)
* i debugger command (alias for info): Debugger Info. (line 13)
* id utility: Id Program. (line 6)
@@ -34963,9 +35012,9 @@ Index
* lint checking, array subscripts: Uninitialized Subscripts.
(line 43)
* lint checking, empty programs: Command Line. (line 16)
-* lint checking, issuing warnings: Options. (line 198)
+* lint checking, issuing warnings: Options. (line 208)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 357)
+ (line 367)
* lint checking, undefined functions: Pass By Value/Reference.
(line 85)
* LINT variable: User-modified. (line 90)
@@ -34978,10 +35027,10 @@ Index
* list function definitions, in debugger: Debugger Info. (line 30)
* loading extensions, @load directive: Loading Shared Libraries.
(line 8)
-* loading, extensions: Options. (line 186)
+* loading, extensions: Options. (line 196)
* local variables, in a function: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 81)
-* locale decimal point character: Options. (line 283)
+* locale decimal point character: Options. (line 293)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
@@ -35064,7 +35113,7 @@ Index
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines: Statements/Lines. (line 6)
-* newlines <1>: Options. (line 277)
+* newlines <1>: Options. (line 287)
* newlines <2>: Boolean Ops. (line 69)
* newlines, as record separators: awk split records. (line 12)
* newlines, in dynamic regexps: Computed Regexps. (line 60)
@@ -35139,7 +35188,7 @@ Index
* o debugger command (alias for option): Debugger Info. (line 57)
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
-* octal values, enabling interpretation of: Options. (line 223)
+* octal values, enabling interpretation of: Options. (line 233)
* OFMT variable: OFMT. (line 15)
* OFMT variable <1>: Strings And Numbers. (line 56)
* OFMT variable <2>: User-modified. (line 107)
@@ -35187,13 +35236,13 @@ Index
(line 66)
* option debugger command: Debugger Info. (line 57)
* options, command-line: Options. (line 6)
-* options, command-line, end of: Options. (line 55)
+* options, command-line, end of: Options. (line 58)
* options, command-line, invoking awk: Command Line. (line 6)
* options, command-line, processing: Getopt Function. (line 6)
* options, deprecated: Obsolete. (line 6)
* options, long: Command Line. (line 13)
* options, long <1>: Options. (line 6)
-* options, printing list of: Options. (line 168)
+* options, printing list of: Options. (line 175)
* or: Bitwise Functions. (line 50)
* OR bitwise operation: Bitwise Functions. (line 6)
* or Boolean-logic operator: Boolean Ops. (line 6)
@@ -35291,13 +35340,13 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 97)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 377)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 387)
* portability, substr() function: String Functions. (line 515)
* portable object files: Explaining gettext. (line 37)
* portable object files <1>: Translator i18n. (line 6)
* portable object files, converting to message object files: I18N Example.
(line 66)
-* portable object files, generating: Options. (line 161)
+* portable object files, generating: Options. (line 168)
* portable object template files: Explaining gettext. (line 31)
* porting gawk: New Ports. (line 6)
* positional specifiers, printf statement: Format Modifiers. (line 13)
@@ -35339,18 +35388,18 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 161)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 56)
-* POSIX mode: Options. (line 271)
-* POSIX mode <1>: Options. (line 357)
+* POSIX mode: Options. (line 281)
+* POSIX mode <1>: Options. (line 367)
* POSIX, awk and: Preface. (line 21)
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
-* POSIXLY_CORRECT environment variable: Options. (line 357)
+* POSIXLY_CORRECT environment variable: Options. (line 367)
* PREC variable: User-modified. (line 127)
* precedence: Increment Ops. (line 60)
* precedence <1>: Precedence. (line 6)
* precedence, regexp operators: Regexp Operators. (line 156)
* predefined variables: Built-in Variables. (line 6)
-* predefined variables, -v option, setting with: Options. (line 41)
+* predefined variables, -v option, setting with: Options. (line 44)
* predefined variables, conveying information: Auto-set. (line 6)
* predefined variables, user-modifiable: User-modified. (line 6)
* print debugger command: Viewing And Changing Data.
@@ -35386,7 +35435,7 @@ Index
* printf statement, syntax of: Basic Printf. (line 6)
* printing: Printing. (line 6)
* printing messages from extensions: Printing Messages. (line 6)
-* printing, list of options: Options. (line 168)
+* printing, list of options: Options. (line 175)
* printing, mailing labels: Labels Program. (line 6)
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
@@ -35527,7 +35576,7 @@ Index
(line 60)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 73)
-* regular expressions, interval expressions and: Options. (line 292)
+* regular expressions, interval expressions and: Options. (line 302)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators: Regexp Usage. (line 19)
@@ -35609,7 +35658,7 @@ Index
(line 68)
* sample debugging session: Sample Debugging Session.
(line 6)
-* sandbox mode: Options. (line 304)
+* sandbox mode: Options. (line 314)
* save debugger options: Debugger Info. (line 85)
* scalar or array: Type Functions. (line 11)
* scalar values: Basic Data Typing. (line 13)
@@ -35771,7 +35820,7 @@ Index
* source code, jawk: Other Versions. (line 117)
* source code, libmawk: Other Versions. (line 125)
* source code, mawk: Other Versions. (line 48)
-* source code, mixing: Options. (line 117)
+* source code, mixing: Options. (line 120)
* source code, pawk: Other Versions. (line 82)
* source code, pawk (Python version): Other Versions. (line 129)
* source code, QSE awk: Other Versions. (line 135)
@@ -35932,7 +35981,7 @@ Index
* translate string: I18N Functions. (line 21)
* translate.awk program: Translate Program. (line 55)
* treating files, as single records: gawk split records. (line 92)
-* troubleshooting, --non-decimal-data option: Options. (line 223)
+* troubleshooting, --non-decimal-data option: Options. (line 233)
* troubleshooting, == operator: Comparison Operators.
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 29)
@@ -35963,7 +36012,7 @@ Index
* troubleshooting, substr() function: String Functions. (line 502)
* troubleshooting, system() function: I/O Functions. (line 129)
* troubleshooting, typographical errors, global variables: Options.
- (line 99)
+ (line 102)
* true, logical: Truth Values. (line 6)
* Trueman, David: History. (line 30)
* Trueman, David <1>: Acknowledgments. (line 47)
@@ -36034,14 +36083,14 @@ Index
* variables, getline command into, using <3>: Getline/Variable/Coprocess.
(line 6)
* variables, global, for library functions: Library Names. (line 11)
-* variables, global, printing list of: Options. (line 94)
+* variables, global, printing list of: Options. (line 97)
* variables, initializing: Using Variables. (line 23)
* variables, local to a function: Variable Scope. (line 6)
* variables, predefined: Built-in Variables. (line 6)
-* variables, predefined -v option, setting with: Options. (line 41)
+* variables, predefined -v option, setting with: Options. (line 44)
* variables, predefined conveying information: Auto-set. (line 6)
* variables, private: Library Names. (line 11)
-* variables, setting: Options. (line 32)
+* variables, setting: Options. (line 35)
* variables, shadowing: Definition Syntax. (line 77)
* variables, types of: Assignment Ops. (line 39)
* variables, types of, comparison expressions and: Typing and Comparison.
@@ -36073,7 +36122,7 @@ Index
* Wall, Larry: Array Intro. (line 6)
* Wall, Larry <1>: Future Extensions. (line 6)
* Wallin, Anders: Contributors. (line 104)
-* warnings, issuing: Options. (line 198)
+* warnings, issuing: Options. (line 208)
* watch debugger command: Viewing And Changing Data.
(line 66)
* watchpoint: Debugging Terms. (line 42)
@@ -36089,7 +36138,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 277)
+* whitespace, newlines as: Options. (line 287)
* Williams, Kent: Contributors. (line 35)
* Woehlke, Matthew: Contributors. (line 80)
* Woods, John: Contributors. (line 28)
@@ -36119,589 +36168,589 @@ Index
Tag Table:
Node: Top1200
-Node: Foreword343786
-Node: Foreword448228
-Node: Preface49760
-Ref: Preface-Footnote-152619
-Ref: Preface-Footnote-252726
-Ref: Preface-Footnote-352960
-Node: History53102
-Node: Names55454
-Ref: Names-Footnote-156548
-Node: This Manual56695
-Ref: This Manual-Footnote-163180
-Node: Conventions63280
-Node: Manual History65634
-Ref: Manual History-Footnote-168629
-Ref: Manual History-Footnote-268670
-Node: How To Contribute68744
-Node: Acknowledgments69395
-Node: Getting Started74281
-Node: Running gawk76720
-Node: One-shot77910
-Node: Read Terminal79173
-Node: Long81166
-Node: Executable Scripts82679
-Ref: Executable Scripts-Footnote-185474
-Node: Comments85577
-Node: Quoting88061
-Node: DOS Quoting93578
-Node: Sample Data Files95633
-Node: Very Simple98228
-Node: Two Rules103130
-Node: More Complex105015
-Node: Statements/Lines107881
-Ref: Statements/Lines-Footnote-1112340
-Node: Other Features112605
-Node: When113541
-Ref: When-Footnote-1115295
-Node: Intro Summary115360
-Node: Invoking Gawk116244
-Node: Command Line117758
-Node: Options118556
-Ref: Options-Footnote-1135199
-Ref: Options-Footnote-2135429
-Node: Other Arguments135454
-Node: Naming Standard Input138401
-Node: Environment Variables139494
-Node: AWKPATH Variable140052
-Ref: AWKPATH Variable-Footnote-1143463
-Ref: AWKPATH Variable-Footnote-2143497
-Node: AWKLIBPATH Variable143758
-Node: Other Environment Variables145015
-Node: Exit Status148836
-Node: Include Files149513
-Node: Loading Shared Libraries153108
-Node: Obsolete154536
-Node: Undocumented155228
-Node: Invoking Summary155525
-Node: Regexp157185
-Node: Regexp Usage158639
-Node: Escape Sequences160676
-Node: Regexp Operators166908
-Ref: Regexp Operators-Footnote-1174324
-Ref: Regexp Operators-Footnote-2174471
-Node: Bracket Expressions174569
-Ref: table-char-classes177045
-Node: Leftmost Longest180182
-Node: Computed Regexps181485
-Node: GNU Regexp Operators184912
-Node: Case-sensitivity188591
-Ref: Case-sensitivity-Footnote-1191478
-Ref: Case-sensitivity-Footnote-2191713
-Node: Regexp Summary191821
-Node: Reading Files193287
-Node: Records195556
-Node: awk split records196289
-Node: gawk split records201220
-Ref: gawk split records-Footnote-1205760
-Node: Fields205797
-Node: Nonconstant Fields208538
-Ref: Nonconstant Fields-Footnote-1210774
-Node: Changing Fields210978
-Node: Field Separators216906
-Node: Default Field Splitting219604
-Node: Regexp Field Splitting220722
-Node: Single Character Fields224075
-Node: Command Line Field Separator225135
-Node: Full Line Fields228353
-Ref: Full Line Fields-Footnote-1229875
-Ref: Full Line Fields-Footnote-2229921
-Node: Field Splitting Summary230022
-Node: Constant Size232096
-Node: Fixed width data232828
-Node: Skipping intervening236295
-Node: Allowing trailing data237093
-Node: Fields with fixed data238130
-Node: Splitting By Content239648
-Ref: Splitting By Content-Footnote-1243298
-Node: Testing field creation243461
-Node: Multiple Line245082
-Ref: Multiple Line-Footnote-1250966
-Node: Getline251145
-Node: Plain Getline253614
-Node: Getline/Variable256255
-Node: Getline/File257406
-Node: Getline/Variable/File258794
-Ref: Getline/Variable/File-Footnote-1260399
-Node: Getline/Pipe260487
-Node: Getline/Variable/Pipe263194
-Node: Getline/Coprocess264329
-Node: Getline/Variable/Coprocess265596
-Node: Getline Notes266338
-Node: Getline Summary269135
-Ref: table-getline-variants269559
-Node: Read Timeout270307
-Ref: Read Timeout-Footnote-1274213
-Node: Retrying Input274271
-Node: Command-line directories275470
-Node: Input Summary276376
-Node: Input Exercises279548
-Node: Printing280276
-Node: Print282110
-Node: Print Examples283567
-Node: Output Separators286347
-Node: OFMT288364
-Node: Printf289720
-Node: Basic Printf290505
-Node: Control Letters292079
-Node: Format Modifiers296067
-Node: Printf Examples302082
-Node: Redirection304568
-Node: Special FD311409
-Ref: Special FD-Footnote-1314577
-Node: Special Files314651
-Node: Other Inherited Files315268
-Node: Special Network316269
-Node: Special Caveats317129
-Node: Close Files And Pipes318078
-Ref: table-close-pipe-return-values324985
-Ref: Close Files And Pipes-Footnote-1325768
-Ref: Close Files And Pipes-Footnote-2325916
-Node: Nonfatal326068
-Node: Output Summary328393
-Node: Output Exercises329615
-Node: Expressions330294
-Node: Values331482
-Node: Constants332160
-Node: Scalar Constants332851
-Ref: Scalar Constants-Footnote-1333715
-Node: Nondecimal-numbers333965
-Node: Regexp Constants336966
-Node: Using Constant Regexps337492
-Node: Standard Regexp Constants338114
-Node: Strong Regexp Constants341302
-Node: Variables344260
-Node: Using Variables344917
-Node: Assignment Options346827
-Node: Conversion348700
-Node: Strings And Numbers349224
-Ref: Strings And Numbers-Footnote-1352287
-Node: Locale influences conversions352396
-Ref: table-locale-affects355154
-Node: All Operators355772
-Node: Arithmetic Ops356401
-Node: Concatenation358907
-Ref: Concatenation-Footnote-1361754
-Node: Assignment Ops361861
-Ref: table-assign-ops366852
-Node: Increment Ops368165
-Node: Truth Values and Conditions371625
-Node: Truth Values372699
-Node: Typing and Comparison373747
-Node: Variable Typing374567
-Ref: Variable Typing-Footnote-1381030
-Ref: Variable Typing-Footnote-2381102
-Node: Comparison Operators381179
-Ref: table-relational-ops381598
-Node: POSIX String Comparison385093
-Ref: POSIX String Comparison-Footnote-1386788
-Ref: POSIX String Comparison-Footnote-2386927
-Node: Boolean Ops387011
-Ref: Boolean Ops-Footnote-1391493
-Node: Conditional Exp391585
-Node: Function Calls393321
-Node: Precedence397198
-Node: Locales400857
-Node: Expressions Summary402489
-Node: Patterns and Actions405062
-Node: Pattern Overview406182
-Node: Regexp Patterns407859
-Node: Expression Patterns408401
-Node: Ranges412182
-Node: BEGIN/END415290
-Node: Using BEGIN/END416051
-Ref: Using BEGIN/END-Footnote-1418787
-Node: I/O And BEGIN/END418893
-Node: BEGINFILE/ENDFILE421207
-Node: Empty424114
-Node: Using Shell Variables424431
-Node: Action Overview426705
-Node: Statements429030
-Node: If Statement430878
-Node: While Statement432373
-Node: Do Statement434401
-Node: For Statement435549
-Node: Switch Statement438707
-Node: Break Statement441093
-Node: Continue Statement443185
-Node: Next Statement445012
-Node: Nextfile Statement447395
-Node: Exit Statement450047
-Node: Built-in Variables452450
-Node: User-modified453583
-Node: Auto-set461350
-Ref: Auto-set-Footnote-1476947
-Ref: Auto-set-Footnote-2477153
-Node: ARGC and ARGV477209
-Node: Pattern Action Summary481422
-Node: Arrays483852
-Node: Array Basics485181
-Node: Array Intro486025
-Ref: figure-array-elements488000
-Ref: Array Intro-Footnote-1490704
-Node: Reference to Elements490832
-Node: Assigning Elements493296
-Node: Array Example493787
-Node: Scanning an Array495546
-Node: Controlling Scanning498568
-Ref: Controlling Scanning-Footnote-1503967
-Node: Numeric Array Subscripts504283
-Node: Uninitialized Subscripts506467
-Node: Delete508086
-Ref: Delete-Footnote-1510838
-Node: Multidimensional510895
-Node: Multiscanning513990
-Node: Arrays of Arrays515581
-Node: Arrays Summary520348
-Node: Functions522441
-Node: Built-in523479
-Node: Calling Built-in524560
-Node: Numeric Functions526556
-Ref: Numeric Functions-Footnote-1531501
-Ref: Numeric Functions-Footnote-2531858
-Ref: Numeric Functions-Footnote-3531906
-Node: String Functions532178
-Ref: String Functions-Footnote-1555836
-Ref: String Functions-Footnote-2555964
-Ref: String Functions-Footnote-3556212
-Node: Gory Details556299
-Ref: table-sub-escapes558090
-Ref: table-sub-proposed559609
-Ref: table-posix-sub560972
-Ref: table-gensub-escapes562513
-Ref: Gory Details-Footnote-1563336
-Node: I/O Functions563490
-Ref: table-system-return-values570072
-Ref: I/O Functions-Footnote-1572052
-Ref: I/O Functions-Footnote-2572200
-Node: Time Functions572320
-Ref: Time Functions-Footnote-1582987
-Ref: Time Functions-Footnote-2583055
-Ref: Time Functions-Footnote-3583213
-Ref: Time Functions-Footnote-4583324
-Ref: Time Functions-Footnote-5583436
-Ref: Time Functions-Footnote-6583663
-Node: Bitwise Functions583929
-Ref: table-bitwise-ops584523
-Ref: Bitwise Functions-Footnote-1590556
-Ref: Bitwise Functions-Footnote-2590729
-Node: Type Functions590920
-Node: I18N Functions593595
-Node: User-defined595246
-Node: Definition Syntax596051
-Ref: Definition Syntax-Footnote-1601738
-Node: Function Example601809
-Ref: Function Example-Footnote-1604731
-Node: Function Caveats604753
-Node: Calling A Function605271
-Node: Variable Scope606229
-Node: Pass By Value/Reference609223
-Node: Return Statement612722
-Node: Dynamic Typing615701
-Node: Indirect Calls616631
-Ref: Indirect Calls-Footnote-1626882
-Node: Functions Summary627010
-Node: Library Functions629715
-Ref: Library Functions-Footnote-1633322
-Ref: Library Functions-Footnote-2633465
-Node: Library Names633636
-Ref: Library Names-Footnote-1637312
-Ref: Library Names-Footnote-2637535
-Node: General Functions637621
-Node: Strtonum Function638724
-Node: Assert Function641746
-Node: Round Function645072
-Node: Cliff Random Function646613
-Node: Ordinal Functions647629
-Ref: Ordinal Functions-Footnote-1650692
-Ref: Ordinal Functions-Footnote-2650944
-Node: Join Function651154
-Ref: Join Function-Footnote-1652924
-Node: Getlocaltime Function653124
-Node: Readfile Function656866
-Node: Shell Quoting658838
-Node: Data File Management660239
-Node: Filetrans Function660871
-Node: Rewind Function664967
-Node: File Checking666877
-Ref: File Checking-Footnote-1668211
-Node: Empty Files668412
-Node: Ignoring Assigns670391
-Node: Getopt Function671941
-Ref: Getopt Function-Footnote-1683410
-Node: Passwd Functions683610
-Ref: Passwd Functions-Footnote-1692449
-Node: Group Functions692537
-Ref: Group Functions-Footnote-1700435
-Node: Walking Arrays700642
-Node: Library Functions Summary703650
-Node: Library Exercises705056
-Node: Sample Programs705521
-Node: Running Examples706291
-Node: Clones707019
-Node: Cut Program708243
-Node: Egrep Program718172
-Ref: Egrep Program-Footnote-1725684
-Node: Id Program725794
-Node: Split Program729474
-Ref: Split Program-Footnote-1732933
-Node: Tee Program733062
-Node: Uniq Program735852
-Node: Wc Program743278
-Ref: Wc Program-Footnote-1747533
-Node: Miscellaneous Programs747627
-Node: Dupword Program748840
-Node: Alarm Program750870
-Node: Translate Program755725
-Ref: Translate Program-Footnote-1760290
-Node: Labels Program760560
-Ref: Labels Program-Footnote-1763911
-Node: Word Sorting763995
-Node: History Sorting768067
-Node: Extract Program769902
-Node: Simple Sed777431
-Node: Igawk Program780505
-Ref: Igawk Program-Footnote-1794836
-Ref: Igawk Program-Footnote-2795038
-Ref: Igawk Program-Footnote-3795160
-Node: Anagram Program795275
-Node: Signature Program798337
-Node: Programs Summary799584
-Node: Programs Exercises800798
-Ref: Programs Exercises-Footnote-1804927
-Node: Advanced Features805018
-Node: Nondecimal Data807008
-Node: Array Sorting808599
-Node: Controlling Array Traversal809299
-Ref: Controlling Array Traversal-Footnote-1817666
-Node: Array Sorting Functions817784
-Ref: Array Sorting Functions-Footnote-1822875
-Node: Two-way I/O823071
-Ref: Two-way I/O-Footnote-1829622
-Ref: Two-way I/O-Footnote-2829809
-Node: TCP/IP Networking829891
-Node: Profiling833009
-Ref: Profiling-Footnote-1841681
-Node: Advanced Features Summary842004
-Node: Internationalization843848
-Node: I18N and L10N845328
-Node: Explaining gettext846015
-Ref: Explaining gettext-Footnote-1851907
-Ref: Explaining gettext-Footnote-2852092
-Node: Programmer i18n852257
-Ref: Programmer i18n-Footnote-1857206
-Node: Translator i18n857255
-Node: String Extraction858049
-Ref: String Extraction-Footnote-1859181
-Node: Printf Ordering859267
-Ref: Printf Ordering-Footnote-1862053
-Node: I18N Portability862117
-Ref: I18N Portability-Footnote-1864573
-Node: I18N Example864636
-Ref: I18N Example-Footnote-1867442
-Node: Gawk I18N867515
-Node: I18N Summary868160
-Node: Debugger869501
-Node: Debugging870503
-Node: Debugging Concepts870944
-Node: Debugging Terms872753
-Node: Awk Debugging875328
-Node: Sample Debugging Session876234
-Node: Debugger Invocation876768
-Node: Finding The Bug878154
-Node: List of Debugger Commands884632
-Node: Breakpoint Control885965
-Node: Debugger Execution Control889659
-Node: Viewing And Changing Data893021
-Node: Execution Stack896395
-Node: Debugger Info898032
-Node: Miscellaneous Debugger Commands902103
-Node: Readline Support907191
-Node: Limitations908087
-Node: Debugging Summary910196
-Node: Namespaces911475
-Node: Global Namespace912161
-Node: Qualified Names913508
-Ref: Qualified Names-Footnote-1914821
-Node: Default Namespace915075
-Node: Changing The Namespace915852
-Node: Internal Name Management917064
-Node: Namespace Example918085
-Node: Namespace Misc920101
-Node: Arbitrary Precision Arithmetic923874
-Node: Computer Arithmetic925361
-Ref: table-numeric-ranges928952
-Ref: Computer Arithmetic-Footnote-1929674
-Node: Math Definitions929731
-Ref: table-ieee-formats933045
-Ref: Math Definitions-Footnote-1933648
-Node: MPFR features933753
-Node: FP Math Caution935470
-Ref: FP Math Caution-Footnote-1936542
-Node: Inexactness of computations936911
-Node: Inexact representation937871
-Node: Comparing FP Values939231
-Node: Errors accumulate940313
-Node: Getting Accuracy941746
-Node: Try To Round944456
-Node: Setting precision945355
-Ref: table-predefined-precision-strings946052
-Node: Setting the rounding mode947882
-Ref: table-gawk-rounding-modes948256
-Ref: Setting the rounding mode-Footnote-1951664
-Node: Arbitrary Precision Integers951843
-Ref: Arbitrary Precision Integers-Footnote-1956748
-Node: Checking for MPFR956897
-Node: POSIX Floating Point Problems958194
-Ref: POSIX Floating Point Problems-Footnote-1962065
-Node: Floating point summary962103
-Node: Dynamic Extensions964293
-Node: Extension Intro965846
-Node: Plugin License967112
-Node: Extension Mechanism Outline967909
-Ref: figure-load-extension968348
-Ref: figure-register-new-function969913
-Ref: figure-call-new-function971005
-Node: Extension API Description973067
-Node: Extension API Functions Introduction974709
-Node: General Data Types980043
-Ref: General Data Types-Footnote-1987248
-Node: Memory Allocation Functions987547
-Ref: Memory Allocation Functions-Footnote-1990699
-Node: Constructor Functions990798
-Node: Registration Functions993797
-Node: Extension Functions994482
-Node: Exit Callback Functions999695
-Node: Extension Version String1000945
-Node: Input Parsers1001608
-Node: Output Wrappers1014315
-Node: Two-way processors1018827
-Node: Printing Messages1021092
-Ref: Printing Messages-Footnote-11022263
-Node: Updating ERRNO1022416
-Node: Requesting Values1023155
-Ref: table-value-types-returned1023892
-Node: Accessing Parameters1024828
-Node: Symbol Table Access1026063
-Node: Symbol table by name1026575
-Node: Symbol table by cookie1029160
-Ref: Symbol table by cookie-Footnote-11033345
-Node: Cached values1033409
-Ref: Cached values-Footnote-11036945
-Node: Array Manipulation1037036
-Ref: Array Manipulation-Footnote-11038127
-Node: Array Data Types1038164
-Ref: Array Data Types-Footnote-11040822
-Node: Array Functions1040914
-Node: Flattening Arrays1045313
-Node: Creating Arrays1052254
-Node: Redirection API1057023
-Node: Extension API Variables1059865
-Node: Extension Versioning1060498
-Ref: gawk-api-version1060935
-Node: Extension API Informational Variables1062663
-Node: Extension API Boilerplate1063727
-Node: Changes from API V11067589
-Node: Finding Extensions1068249
-Node: Extension Example1068808
-Node: Internal File Description1069606
-Node: Internal File Ops1073686
-Ref: Internal File Ops-Footnote-11085086
-Node: Using Internal File Ops1085226
-Ref: Using Internal File Ops-Footnote-11087609
-Node: Extension Samples1087883
-Node: Extension Sample File Functions1089412
-Node: Extension Sample Fnmatch1097061
-Node: Extension Sample Fork1098548
-Node: Extension Sample Inplace1099766
-Node: Extension Sample Ord1102983
-Node: Extension Sample Readdir1103819
-Ref: table-readdir-file-types1104708
-Node: Extension Sample Revout1105513
-Node: Extension Sample Rev2way1106102
-Node: Extension Sample Read write array1106842
-Node: Extension Sample Readfile1108784
-Node: Extension Sample Time1109879
-Node: Extension Sample API Tests1111227
-Node: gawkextlib1111719
-Node: Extension summary1114166
-Node: Extension Exercises1117868
-Node: Language History1119366
-Node: V7/SVR3.11121022
-Node: SVR41123174
-Node: POSIX1124608
-Node: BTL1125987
-Node: POSIX/GNU1126716
-Node: Feature History1132608
-Node: Common Extensions1147032
-Node: Ranges and Locales1148315
-Ref: Ranges and Locales-Footnote-11152931
-Ref: Ranges and Locales-Footnote-21152958
-Ref: Ranges and Locales-Footnote-31153193
-Node: Contributors1153414
-Node: History summary1158974
-Node: Installation1160354
-Node: Gawk Distribution1161298
-Node: Getting1161782
-Node: Extracting1162743
-Node: Distribution contents1164381
-Node: Unix Installation1170723
-Node: Quick Installation1171405
-Node: Shell Startup Files1173819
-Node: Additional Configuration Options1174908
-Node: Configuration Philosophy1176897
-Node: Non-Unix Installation1179266
-Node: PC Installation1179726
-Node: PC Binary Installation1180564
-Node: PC Compiling1180999
-Node: PC Using1182116
-Node: Cygwin1185161
-Node: MSYS1185931
-Node: VMS Installation1186432
-Node: VMS Compilation1187223
-Ref: VMS Compilation-Footnote-11188452
-Node: VMS Dynamic Extensions1188510
-Node: VMS Installation Details1190195
-Node: VMS Running1192448
-Node: VMS GNV1196727
-Node: VMS Old Gawk1197462
-Node: Bugs1197933
-Node: Bug address1198596
-Node: Usenet1200993
-Node: Maintainers1201770
-Node: Other Versions1203146
-Node: Installation summary1209730
-Node: Notes1210765
-Node: Compatibility Mode1211630
-Node: Additions1212412
-Node: Accessing The Source1213337
-Node: Adding Code1214772
-Node: New Ports1220990
-Node: Derived Files1225478
-Ref: Derived Files-Footnote-11230963
-Ref: Derived Files-Footnote-21230998
-Ref: Derived Files-Footnote-31231596
-Node: Future Extensions1231710
-Node: Implementation Limitations1232368
-Node: Extension Design1233551
-Node: Old Extension Problems1234705
-Ref: Old Extension Problems-Footnote-11236223
-Node: Extension New Mechanism Goals1236280
-Ref: Extension New Mechanism Goals-Footnote-11239644
-Node: Extension Other Design Decisions1239833
-Node: Extension Future Growth1241946
-Node: Old Extension Mechanism1242782
-Node: Notes summary1244545
-Node: Basic Concepts1245727
-Node: Basic High Level1246408
-Ref: figure-general-flow1246690
-Ref: figure-process-flow1247375
-Ref: Basic High Level-Footnote-11250676
-Node: Basic Data Typing1250861
-Node: Glossary1254189
-Node: Copying1286136
-Node: GNU Free Documentation License1323675
-Node: Index1348793
+Node: Foreword343937
+Node: Foreword448379
+Node: Preface49911
+Ref: Preface-Footnote-152770
+Ref: Preface-Footnote-252877
+Ref: Preface-Footnote-353111
+Node: History53253
+Node: Names55605
+Ref: Names-Footnote-156699
+Node: This Manual56846
+Ref: This Manual-Footnote-163485
+Node: Conventions63585
+Node: Manual History65939
+Ref: Manual History-Footnote-168934
+Ref: Manual History-Footnote-268975
+Node: How To Contribute69049
+Node: Acknowledgments69700
+Node: Getting Started74586
+Node: Running gawk77025
+Node: One-shot78215
+Node: Read Terminal79478
+Node: Long81471
+Node: Executable Scripts82984
+Ref: Executable Scripts-Footnote-185779
+Node: Comments85882
+Node: Quoting88366
+Node: DOS Quoting93883
+Node: Sample Data Files95938
+Node: Very Simple98533
+Node: Two Rules103435
+Node: More Complex105320
+Node: Statements/Lines108186
+Ref: Statements/Lines-Footnote-1112645
+Node: Other Features112910
+Node: When113846
+Ref: When-Footnote-1115600
+Node: Intro Summary115665
+Node: Invoking Gawk116549
+Node: Command Line118063
+Node: Options118861
+Ref: Options-Footnote-1135957
+Ref: Options-Footnote-2136187
+Node: Other Arguments136212
+Node: Naming Standard Input139159
+Node: Environment Variables140252
+Node: AWKPATH Variable140810
+Ref: AWKPATH Variable-Footnote-1144221
+Ref: AWKPATH Variable-Footnote-2144255
+Node: AWKLIBPATH Variable144516
+Node: Other Environment Variables145773
+Node: Exit Status149594
+Node: Include Files150271
+Node: Loading Shared Libraries154019
+Node: Obsolete155447
+Node: Undocumented156139
+Node: Invoking Summary156436
+Node: Regexp158096
+Node: Regexp Usage159550
+Node: Escape Sequences161587
+Node: Regexp Operators167819
+Ref: Regexp Operators-Footnote-1175235
+Ref: Regexp Operators-Footnote-2175382
+Node: Bracket Expressions175480
+Ref: table-char-classes177956
+Node: Leftmost Longest181093
+Node: Computed Regexps182396
+Node: GNU Regexp Operators185823
+Node: Case-sensitivity189502
+Ref: Case-sensitivity-Footnote-1192389
+Ref: Case-sensitivity-Footnote-2192624
+Node: Regexp Summary192732
+Node: Reading Files194198
+Node: Records196467
+Node: awk split records197200
+Node: gawk split records202131
+Ref: gawk split records-Footnote-1206671
+Node: Fields206708
+Node: Nonconstant Fields209449
+Ref: Nonconstant Fields-Footnote-1211685
+Node: Changing Fields211889
+Node: Field Separators217817
+Node: Default Field Splitting220515
+Node: Regexp Field Splitting221633
+Node: Single Character Fields224986
+Node: Command Line Field Separator226046
+Node: Full Line Fields229264
+Ref: Full Line Fields-Footnote-1230786
+Ref: Full Line Fields-Footnote-2230832
+Node: Field Splitting Summary230933
+Node: Constant Size233007
+Node: Fixed width data233739
+Node: Skipping intervening237206
+Node: Allowing trailing data238004
+Node: Fields with fixed data239041
+Node: Splitting By Content240559
+Ref: Splitting By Content-Footnote-1244209
+Node: Testing field creation244372
+Node: Multiple Line245993
+Ref: Multiple Line-Footnote-1251877
+Node: Getline252056
+Node: Plain Getline254525
+Node: Getline/Variable257166
+Node: Getline/File258317
+Node: Getline/Variable/File259705
+Ref: Getline/Variable/File-Footnote-1261310
+Node: Getline/Pipe261398
+Node: Getline/Variable/Pipe264105
+Node: Getline/Coprocess265240
+Node: Getline/Variable/Coprocess266507
+Node: Getline Notes267249
+Node: Getline Summary270046
+Ref: table-getline-variants270470
+Node: Read Timeout271218
+Ref: Read Timeout-Footnote-1275124
+Node: Retrying Input275182
+Node: Command-line directories276381
+Node: Input Summary277287
+Node: Input Exercises280459
+Node: Printing281187
+Node: Print283021
+Node: Print Examples284478
+Node: Output Separators287258
+Node: OFMT289275
+Node: Printf290631
+Node: Basic Printf291416
+Node: Control Letters292990
+Node: Format Modifiers296978
+Node: Printf Examples302993
+Node: Redirection305479
+Node: Special FD312320
+Ref: Special FD-Footnote-1315488
+Node: Special Files315562
+Node: Other Inherited Files316179
+Node: Special Network317180
+Node: Special Caveats318040
+Node: Close Files And Pipes318989
+Ref: table-close-pipe-return-values325896
+Ref: Close Files And Pipes-Footnote-1326679
+Ref: Close Files And Pipes-Footnote-2326827
+Node: Nonfatal326979
+Node: Output Summary329304
+Node: Output Exercises330526
+Node: Expressions331205
+Node: Values332393
+Node: Constants333071
+Node: Scalar Constants333762
+Ref: Scalar Constants-Footnote-1334626
+Node: Nondecimal-numbers334876
+Node: Regexp Constants337877
+Node: Using Constant Regexps338403
+Node: Standard Regexp Constants339025
+Node: Strong Regexp Constants342213
+Node: Variables345171
+Node: Using Variables345828
+Node: Assignment Options347738
+Node: Conversion349611
+Node: Strings And Numbers350135
+Ref: Strings And Numbers-Footnote-1353198
+Node: Locale influences conversions353307
+Ref: table-locale-affects356065
+Node: All Operators356683
+Node: Arithmetic Ops357312
+Node: Concatenation359818
+Ref: Concatenation-Footnote-1362665
+Node: Assignment Ops362772
+Ref: table-assign-ops367763
+Node: Increment Ops369076
+Node: Truth Values and Conditions372536
+Node: Truth Values373610
+Node: Typing and Comparison374658
+Node: Variable Typing375478
+Ref: Variable Typing-Footnote-1381941
+Ref: Variable Typing-Footnote-2382013
+Node: Comparison Operators382090
+Ref: table-relational-ops382509
+Node: POSIX String Comparison386004
+Ref: POSIX String Comparison-Footnote-1387699
+Ref: POSIX String Comparison-Footnote-2387838
+Node: Boolean Ops387922
+Ref: Boolean Ops-Footnote-1392404
+Node: Conditional Exp392496
+Node: Function Calls394232
+Node: Precedence398109
+Node: Locales401768
+Node: Expressions Summary403400
+Node: Patterns and Actions405973
+Node: Pattern Overview407093
+Node: Regexp Patterns408770
+Node: Expression Patterns409312
+Node: Ranges413093
+Node: BEGIN/END416201
+Node: Using BEGIN/END416962
+Ref: Using BEGIN/END-Footnote-1419698
+Node: I/O And BEGIN/END419804
+Node: BEGINFILE/ENDFILE422118
+Node: Empty425025
+Node: Using Shell Variables425342
+Node: Action Overview427616
+Node: Statements429941
+Node: If Statement431789
+Node: While Statement433284
+Node: Do Statement435312
+Node: For Statement436460
+Node: Switch Statement439618
+Node: Break Statement442004
+Node: Continue Statement444096
+Node: Next Statement445923
+Node: Nextfile Statement448306
+Node: Exit Statement450958
+Node: Built-in Variables453361
+Node: User-modified454494
+Node: Auto-set462261
+Ref: Auto-set-Footnote-1477858
+Ref: Auto-set-Footnote-2478064
+Node: ARGC and ARGV478120
+Node: Pattern Action Summary482333
+Node: Arrays484763
+Node: Array Basics486092
+Node: Array Intro486936
+Ref: figure-array-elements488911
+Ref: Array Intro-Footnote-1491615
+Node: Reference to Elements491743
+Node: Assigning Elements494207
+Node: Array Example494698
+Node: Scanning an Array496457
+Node: Controlling Scanning499479
+Ref: Controlling Scanning-Footnote-1504878
+Node: Numeric Array Subscripts505194
+Node: Uninitialized Subscripts507378
+Node: Delete508997
+Ref: Delete-Footnote-1511749
+Node: Multidimensional511806
+Node: Multiscanning514901
+Node: Arrays of Arrays516492
+Node: Arrays Summary521259
+Node: Functions523352
+Node: Built-in524390
+Node: Calling Built-in525471
+Node: Numeric Functions527467
+Ref: Numeric Functions-Footnote-1532412
+Ref: Numeric Functions-Footnote-2532769
+Ref: Numeric Functions-Footnote-3532817
+Node: String Functions533089
+Ref: String Functions-Footnote-1556747
+Ref: String Functions-Footnote-2556875
+Ref: String Functions-Footnote-3557123
+Node: Gory Details557210
+Ref: table-sub-escapes559001
+Ref: table-sub-proposed560520
+Ref: table-posix-sub561883
+Ref: table-gensub-escapes563424
+Ref: Gory Details-Footnote-1564247
+Node: I/O Functions564401
+Ref: table-system-return-values570983
+Ref: I/O Functions-Footnote-1572963
+Ref: I/O Functions-Footnote-2573111
+Node: Time Functions573231
+Ref: Time Functions-Footnote-1583898
+Ref: Time Functions-Footnote-2583966
+Ref: Time Functions-Footnote-3584124
+Ref: Time Functions-Footnote-4584235
+Ref: Time Functions-Footnote-5584347
+Ref: Time Functions-Footnote-6584574
+Node: Bitwise Functions584840
+Ref: table-bitwise-ops585434
+Ref: Bitwise Functions-Footnote-1591467
+Ref: Bitwise Functions-Footnote-2591640
+Node: Type Functions591831
+Node: I18N Functions594506
+Node: User-defined596157
+Node: Definition Syntax596962
+Ref: Definition Syntax-Footnote-1602649
+Node: Function Example602720
+Ref: Function Example-Footnote-1605642
+Node: Function Caveats605664
+Node: Calling A Function606182
+Node: Variable Scope607140
+Node: Pass By Value/Reference610134
+Node: Return Statement613633
+Node: Dynamic Typing616612
+Node: Indirect Calls617542
+Ref: Indirect Calls-Footnote-1627793
+Node: Functions Summary627921
+Node: Library Functions630626
+Ref: Library Functions-Footnote-1634233
+Ref: Library Functions-Footnote-2634376
+Node: Library Names634547
+Ref: Library Names-Footnote-1638223
+Ref: Library Names-Footnote-2638446
+Node: General Functions638532
+Node: Strtonum Function639635
+Node: Assert Function642657
+Node: Round Function645983
+Node: Cliff Random Function647524
+Node: Ordinal Functions648540
+Ref: Ordinal Functions-Footnote-1651603
+Ref: Ordinal Functions-Footnote-2651855
+Node: Join Function652065
+Ref: Join Function-Footnote-1653835
+Node: Getlocaltime Function654035
+Node: Readfile Function657777
+Node: Shell Quoting659749
+Node: Data File Management661150
+Node: Filetrans Function661782
+Node: Rewind Function665878
+Node: File Checking667788
+Ref: File Checking-Footnote-1669122
+Node: Empty Files669323
+Node: Ignoring Assigns671302
+Node: Getopt Function672852
+Ref: Getopt Function-Footnote-1684321
+Node: Passwd Functions684521
+Ref: Passwd Functions-Footnote-1693360
+Node: Group Functions693448
+Ref: Group Functions-Footnote-1701346
+Node: Walking Arrays701553
+Node: Library Functions Summary704561
+Node: Library Exercises705967
+Node: Sample Programs706432
+Node: Running Examples707202
+Node: Clones707930
+Node: Cut Program709154
+Node: Egrep Program719083
+Ref: Egrep Program-Footnote-1726595
+Node: Id Program726705
+Node: Split Program730385
+Ref: Split Program-Footnote-1733844
+Node: Tee Program733973
+Node: Uniq Program736763
+Node: Wc Program744189
+Ref: Wc Program-Footnote-1748444
+Node: Miscellaneous Programs748538
+Node: Dupword Program749751
+Node: Alarm Program751781
+Node: Translate Program756636
+Ref: Translate Program-Footnote-1761201
+Node: Labels Program761471
+Ref: Labels Program-Footnote-1764822
+Node: Word Sorting764906
+Node: History Sorting768978
+Node: Extract Program770813
+Node: Simple Sed778342
+Node: Igawk Program781416
+Ref: Igawk Program-Footnote-1795747
+Ref: Igawk Program-Footnote-2795949
+Ref: Igawk Program-Footnote-3796071
+Node: Anagram Program796186
+Node: Signature Program799248
+Node: Programs Summary800495
+Node: Programs Exercises801709
+Ref: Programs Exercises-Footnote-1805838
+Node: Advanced Features805929
+Node: Nondecimal Data807919
+Node: Array Sorting809510
+Node: Controlling Array Traversal810210
+Ref: Controlling Array Traversal-Footnote-1818577
+Node: Array Sorting Functions818695
+Ref: Array Sorting Functions-Footnote-1823786
+Node: Two-way I/O823982
+Ref: Two-way I/O-Footnote-1830533
+Ref: Two-way I/O-Footnote-2830720
+Node: TCP/IP Networking830802
+Node: Profiling833920
+Ref: Profiling-Footnote-1842592
+Node: Advanced Features Summary842915
+Node: Internationalization844759
+Node: I18N and L10N846239
+Node: Explaining gettext846926
+Ref: Explaining gettext-Footnote-1852818
+Ref: Explaining gettext-Footnote-2853003
+Node: Programmer i18n853168
+Ref: Programmer i18n-Footnote-1858117
+Node: Translator i18n858166
+Node: String Extraction858960
+Ref: String Extraction-Footnote-1860092
+Node: Printf Ordering860178
+Ref: Printf Ordering-Footnote-1862964
+Node: I18N Portability863028
+Ref: I18N Portability-Footnote-1865484
+Node: I18N Example865547
+Ref: I18N Example-Footnote-1868353
+Node: Gawk I18N868426
+Node: I18N Summary869071
+Node: Debugger870412
+Node: Debugging871414
+Node: Debugging Concepts871855
+Node: Debugging Terms873664
+Node: Awk Debugging876239
+Node: Sample Debugging Session877145
+Node: Debugger Invocation877679
+Node: Finding The Bug879065
+Node: List of Debugger Commands885543
+Node: Breakpoint Control886876
+Node: Debugger Execution Control890570
+Node: Viewing And Changing Data893932
+Node: Execution Stack897306
+Node: Debugger Info898943
+Node: Miscellaneous Debugger Commands903014
+Node: Readline Support908102
+Node: Limitations908998
+Node: Debugging Summary911107
+Node: Namespaces912386
+Node: Global Namespace913142
+Node: Qualified Names914496
+Node: Default Namespace915493
+Node: Changing The Namespace916234
+Node: Naming Rules917822
+Node: Internal Name Management919671
+Node: Namespace Example920713
+Node: Namespace Misc923174
+Node: Arbitrary Precision Arithmetic925524
+Node: Computer Arithmetic927011
+Ref: table-numeric-ranges930602
+Ref: Computer Arithmetic-Footnote-1931324
+Node: Math Definitions931381
+Ref: table-ieee-formats934695
+Ref: Math Definitions-Footnote-1935298
+Node: MPFR features935403
+Node: FP Math Caution937120
+Ref: FP Math Caution-Footnote-1938192
+Node: Inexactness of computations938561
+Node: Inexact representation939521
+Node: Comparing FP Values940881
+Node: Errors accumulate941963
+Node: Getting Accuracy943396
+Node: Try To Round946106
+Node: Setting precision947005
+Ref: table-predefined-precision-strings947702
+Node: Setting the rounding mode949532
+Ref: table-gawk-rounding-modes949906
+Ref: Setting the rounding mode-Footnote-1953314
+Node: Arbitrary Precision Integers953493
+Ref: Arbitrary Precision Integers-Footnote-1958398
+Node: Checking for MPFR958547
+Node: POSIX Floating Point Problems959844
+Ref: POSIX Floating Point Problems-Footnote-1963715
+Node: Floating point summary963753
+Node: Dynamic Extensions965943
+Node: Extension Intro967496
+Node: Plugin License968762
+Node: Extension Mechanism Outline969559
+Ref: figure-load-extension969998
+Ref: figure-register-new-function971563
+Ref: figure-call-new-function972655
+Node: Extension API Description974717
+Node: Extension API Functions Introduction976359
+Node: General Data Types981693
+Ref: General Data Types-Footnote-1988898
+Node: Memory Allocation Functions989197
+Ref: Memory Allocation Functions-Footnote-1992349
+Node: Constructor Functions992448
+Node: Registration Functions995447
+Node: Extension Functions996132
+Node: Exit Callback Functions1001345
+Node: Extension Version String1002595
+Node: Input Parsers1003258
+Node: Output Wrappers1015965
+Node: Two-way processors1020477
+Node: Printing Messages1022742
+Ref: Printing Messages-Footnote-11023913
+Node: Updating ERRNO1024066
+Node: Requesting Values1024805
+Ref: table-value-types-returned1025542
+Node: Accessing Parameters1026478
+Node: Symbol Table Access1027713
+Node: Symbol table by name1028225
+Node: Symbol table by cookie1030810
+Ref: Symbol table by cookie-Footnote-11034995
+Node: Cached values1035059
+Ref: Cached values-Footnote-11038595
+Node: Array Manipulation1038686
+Ref: Array Manipulation-Footnote-11039777
+Node: Array Data Types1039814
+Ref: Array Data Types-Footnote-11042472
+Node: Array Functions1042564
+Node: Flattening Arrays1046963
+Node: Creating Arrays1053904
+Node: Redirection API1058673
+Node: Extension API Variables1061515
+Node: Extension Versioning1062148
+Ref: gawk-api-version1062585
+Node: Extension API Informational Variables1064313
+Node: Extension API Boilerplate1065377
+Node: Changes from API V11069239
+Node: Finding Extensions1069899
+Node: Extension Example1070458
+Node: Internal File Description1071256
+Node: Internal File Ops1075336
+Ref: Internal File Ops-Footnote-11086736
+Node: Using Internal File Ops1086876
+Ref: Using Internal File Ops-Footnote-11089259
+Node: Extension Samples1089533
+Node: Extension Sample File Functions1091062
+Node: Extension Sample Fnmatch1098711
+Node: Extension Sample Fork1100198
+Node: Extension Sample Inplace1101416
+Node: Extension Sample Ord1104633
+Node: Extension Sample Readdir1105469
+Ref: table-readdir-file-types1106358
+Node: Extension Sample Revout1107163
+Node: Extension Sample Rev2way1107752
+Node: Extension Sample Read write array1108492
+Node: Extension Sample Readfile1110434
+Node: Extension Sample Time1111529
+Node: Extension Sample API Tests1112877
+Node: gawkextlib1113369
+Node: Extension summary1115816
+Node: Extension Exercises1119518
+Node: Language History1121016
+Node: V7/SVR3.11122672
+Node: SVR41124824
+Node: POSIX1126258
+Node: BTL1127637
+Node: POSIX/GNU1128366
+Node: Feature History1134258
+Node: Common Extensions1148682
+Node: Ranges and Locales1149965
+Ref: Ranges and Locales-Footnote-11154581
+Ref: Ranges and Locales-Footnote-21154608
+Ref: Ranges and Locales-Footnote-31154843
+Node: Contributors1155064
+Node: History summary1160624
+Node: Installation1162004
+Node: Gawk Distribution1162948
+Node: Getting1163432
+Node: Extracting1164393
+Node: Distribution contents1166031
+Node: Unix Installation1172373
+Node: Quick Installation1173055
+Node: Shell Startup Files1175469
+Node: Additional Configuration Options1176558
+Node: Configuration Philosophy1178547
+Node: Non-Unix Installation1180916
+Node: PC Installation1181376
+Node: PC Binary Installation1182214
+Node: PC Compiling1182649
+Node: PC Using1183766
+Node: Cygwin1186811
+Node: MSYS1187581
+Node: VMS Installation1188082
+Node: VMS Compilation1188873
+Ref: VMS Compilation-Footnote-11190102
+Node: VMS Dynamic Extensions1190160
+Node: VMS Installation Details1191845
+Node: VMS Running1194098
+Node: VMS GNV1198377
+Node: VMS Old Gawk1199112
+Node: Bugs1199583
+Node: Bug address1200246
+Node: Usenet1202643
+Node: Maintainers1203420
+Node: Other Versions1204796
+Node: Installation summary1211380
+Node: Notes1212415
+Node: Compatibility Mode1213280
+Node: Additions1214062
+Node: Accessing The Source1214987
+Node: Adding Code1216422
+Node: New Ports1222640
+Node: Derived Files1227128
+Ref: Derived Files-Footnote-11232613
+Ref: Derived Files-Footnote-21232648
+Ref: Derived Files-Footnote-31233246
+Node: Future Extensions1233360
+Node: Implementation Limitations1234018
+Node: Extension Design1235201
+Node: Old Extension Problems1236355
+Ref: Old Extension Problems-Footnote-11237873
+Node: Extension New Mechanism Goals1237930
+Ref: Extension New Mechanism Goals-Footnote-11241294
+Node: Extension Other Design Decisions1241483
+Node: Extension Future Growth1243596
+Node: Old Extension Mechanism1244432
+Node: Notes summary1246195
+Node: Basic Concepts1247377
+Node: Basic High Level1248058
+Ref: figure-general-flow1248340
+Ref: figure-process-flow1249025
+Ref: Basic High Level-Footnote-11252326
+Node: Basic Data Typing1252511
+Node: Glossary1255839
+Node: Copying1287786
+Node: GNU Free Documentation License1325325
+Node: Index1350443
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 2dcf023..430a125 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -899,6 +899,8 @@ particular records in a file and perform operations upon
them.
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
+* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
* Computer Arithmetic:: A quick intro to computer math.
@@ -1720,6 +1722,10 @@ messages into different languages at runtime.
@ref{Debugger}, describes the @command{gawk} debugger.
@item
address@hidden, describes how @command{gawk} allows variables and/or
+functions of the same name to be in different namespaces.
+
address@hidden
@ref{Arbitrary Precision Arithmetic},
describes advanced arithmetic facilities.
@@ -3835,6 +3841,9 @@ This option may be given multiple times; the @command{awk}
program consists of the concatenation of the contents of
each specified @var{source-file}.
+Files named with @option{-i} are treated as if they had @samp{@@namespace
"awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@item -v @address@hidden
@itemx --assign @address@hidden
@cindex @option{-v} option
@@ -3992,6 +4001,10 @@ $ @kbd{gawk -e 'BEGIN @{ a = 5 ;' -e 'print a @}'}
@noindent
However, this is no longer true. If you have any scripts that
rely upon this feature, you should revise them.
+
+This is because each @var{program-text} is treated as if it had
address@hidden@@namespace "awk"} at its beginning. @xref{Namespaces}, for more
+information.
@end quotation
@item @option{-E} @var{file}
@@ -4070,6 +4083,9 @@ input. Thus, after processing an @option{-i} argument,
@command{gawk}
still expects to find the main source code via the @option{-f} option
or on the command line.
+Files named with @option{-i} are treated as if they had @samp{@@namespace
"awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@item @option{-l} @var{ext}
@itemx @option{--load} @var{ext}
@cindex @option{-l} option
@@ -4847,6 +4863,10 @@ As mentioned in @ref{AWKPATH Variable}, the current
directory is always
searched first for source files, before searching in @env{AWKPATH};
this also applies to files named with @code{@@include}.
+Finally, files included with @code{@@include}
+are treated as if they had @samp{@@namespace "awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@node Loading Shared Libraries
@section Loading Dynamic Extensions into Your Program
@@ -31224,6 +31244,7 @@ This @value{CHAPTER} describes a feature that is
specific to @command{gawk}.
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
@@ -31253,46 +31274,32 @@ less chance for collisions.) These facilities are
sometimes referred
to as @dfn{packages} or @dfn{modules}.
Starting with @value{PVERSION} @strong{FIXME} 5.0, @command{gawk} provides a
-mechanism to put functions and global variables into separate namespaces.
+simple mechanism to put functions and global variables into separate
namespaces.
@node Qualified Names
@section Qualified Names
-A @dfn{qualified name} is an identifier that includes a namespace
-name and the namespace separator, @code{::}. For example, one
-might have a function named @code{posix::getpid()}. Here, the
-namespace is @code{posix} and the function name within the namespace
-is @code{getpid()}. The namespace and variable or function name are
-separated by a double-colon. Only one such separator is allowed in a
-qualified name.
+A @dfn{qualified name} is an identifier that includes a namespace name,
+the namespace separator @code{::}, and a component name. For example, one
+might have a function named @code{posix::getpid()}. Here, the namespace
+is @code{posix} and the function name within the namespace (the component)
+is @code{getpid()}. The namespace and component names are separated by
+a double-colon. Only one such separator is allowed in a qualified name.
@quotation NOTE
Unlike C++, the @code{::} is @emph{not} an operator. No spaces are
-allowed between the namespace name, the @code{::}, and the rest of
-the name.
+allowed between the namespace name, the @code{::}, and the component name.
@end quotation
-You must use fully qualified names from one namespace to access variables
+You must use qualified names from one namespace to access variables
and functions in another. This is especially important when using
variable names to index the special @code{SYMTAB} array (@pxref{Auto-set}),
and when making indirect function calls (@pxref{Indirect Calls}).
-It is a fatal error to use any @command{gawk} reserved word (such
-as @code{if} or @code{for}), or the name of any built-in function
-(such as @code{sin()} or @code{gsub()}) as either part of a
-fully qualified address@hidden hope to improve the implementation so
-that this restriction will apply only to standard @command{awk}
-reserved words and built-in functions. In this case, the additional
-built-in functions defined by @command{gawk} will become pre-loaded
-extension functions.}
-
address@hidden pre-defined variable names may be used:
address@hidden::NR} is valid, if possibly not all that useful.
-
@node Default Namespace
@section The Default Namespace
-The default namespace, not surprisingly, is @samp{awk}.
+The default namespace, not surprisingly, is @code{awk}.
All of the predefined @command{awk} and @command{gawk} variables
are in this namespace, and thus have qualified names like
@code{awk::ARGC}, @code{awk::NF}, and so on.
@@ -31300,10 +31307,9 @@ are in this namespace, and thus have qualified names
like
Furthermore, even when you have changed the namespace for your
current source file (@pxref{Changing The Namespace}), @command{gawk}
forces unqualified identifiers whose names are all uppercase letters
-to be in the @samp{awk} namespace. This makes it possible for you to easily
+to be in the @code{awk} namespace. This makes it possible for you to easily
reference @command{gawk}'s global variables from different namespaces.
-
-It is a syntax error to use qualified names for function parameter names.
+It also keeps your code looking natural.
@node Changing The Namespace
@section Changing The Namespace
@@ -31327,9 +31333,9 @@ do it too much.
@quotation NOTE
Association of unqualified identifiers to a namespace is handled while
-your program is being parsed by @command{gawk} and before it starts
-to run. There is no concept of a ``current'' namespace once your program
-starts executing. Be sure you understand this.
address@hidden parses your program, before it starts to run. There is
+no concept of a ``current'' namespace once your program starts executing.
+Be sure you understand this.
@end quotation
Each source file for @option{-i} and @option{-f} starts out with
@@ -31337,19 +31343,93 @@ an implicit @samp{@@namespace "awk"}. Similarly,
each chunk of
command-line code supplied with @option{-e} has such an implicit
initial statement (@pxref{Options}).
+Files included with @code{@@include} (@pxref{Include Files}) ``push'' and
+``pop'' the current namespace. That is, each @code{@@include} saves the
+current namespace and starts over with an implicit @samp{@@namespace
+"awk"} until an explicit @samp{@@namespace} statement is seen.
+When @command{gawk} finishes processing the included file, the saved
+namespace is restored and processing continues where it left off in the
+original file.
+
The use of @samp{@@namespace} has no influence upon the order of execution
of @code{BEGIN}, @code{BEGINFILE}, @code{END}, and @code{ENDFILE} rules.
address@hidden Naming Rules
address@hidden Namespace and Component Naming Rules
+
+A number of rules apply to the namespace and component names, as follows.
+
address@hidden @bullet
address@hidden
+It is a syntax error to use qualified names for function parameter names.
+
address@hidden
+It is a syntax error to use any standard @command{awk} reserved word (such
+as @code{if} or @code{for}), or the name of any standard built-in function
+(such as @code{sin()} or @code{gsub()}) as either part of a qualified name.
+Thus, the following produces a syntax error:
+
address@hidden
+@@namespace "example"
+
+function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
+
address@hidden
+Outside the @code{awk} namespace, the names of the additional @command{gawk}
+built-in functions (such as @code{gensub()} or @code{strftime()}) @emph{may}
+be used as a component name. The same set of names may be used as namespace
+names, although this has the potential to be confusing.
+
address@hidden
+The additional @command{gawk} built-in functions may still be called
+from outside the @code{awk} namespace by qualifying them. For example,
address@hidden::systime()}. Here is a somewhat silly example demonstrating
+this rule and the previous one:
+
address@hidden
+BEGIN @{
+ print "in awk namespace, systime() =", systime()
address@hidden
+
+@@namespace "testing"
+
+function systime()
address@hidden
+ print "in testing namespace, systime() =", awk::systime()
address@hidden
+
+BEGIN @{
+ systime()
address@hidden
address@hidden example
+
address@hidden
+
+When run, it produces output like this:
+
address@hidden
+$ @kbd{gawk -f systime.awk}
address@hidden in awk namespace, systime() = 1500488503
address@hidden in testing namespace, systime() = 1500488503
address@hidden example
+
address@hidden
address@hidden pre-defined variable names may be used:
address@hidden::NR} is valid, if possibly not all that useful.
address@hidden itemize
+
@node Internal Name Management
@section Internal Name Management
-For backwards compatibility, all identifiers in the @samp{awk} namespace
-are stored internally as unadorned identifiers. This is mainly relevant
+For backwards compatibility, all identifiers in the @code{awk} namespace
+are stored internally as unadorned identifiers (that is, without a
+leading @samp{awk::}). This is mainly relevant
when using such identifiers as indices for @code{SYMTAB}, @code{FUNCTAB},
and @code{PROCINFO["identifiers"]} (@pxref{Auto-set}), and for use in
indirect function calls (@pxref{Indirect Calls}).
-In program code, to refer to variables and functions in the @samp{awk}
+In program code, to refer to variables and functions in the @code{awk}
namespace from another namespace, you must still use the @samp{awk::}
prefix. For example:
@@ -31357,7 +31437,7 @@ prefix. For example:
@@namespace "awk" @ii{This is the default namespace}
BEGIN @{
- Title = "My Report" @ii{Fully qualified name is} awk::Title
+ Title = "My Report" @ii{Qualified name is} awk::Title
@}
@@namespace "report" @ii{Now in} report @ii{namespace}
@@ -31373,12 +31453,13 @@ function compute() @ii{This is really}
report::compute()
@section Namespace Example
The following example is a revised version of the suite of routines
-developed in @ref{Passwd Functions}.
+developed in @ref{Passwd Functions}. See there for an explanation
+of how the code works.
The formulation here, due mainly to Andrew Schorr, is rather elegant.
-It places all of the implementation functions and variables in the
address@hidden namespace, while leaving the main interface functions
-in the default @code{awk} namespace.
+All of the implementation functions and variables are in the
address@hidden namespace, whereas the main interface functions are
+defined in the @code{awk} namespace.
@example
@c file eg/lib/ns_passwd.awk
@@ -31467,9 +31548,33 @@ As you can see, this version also follows the
convention mentioned in
@ref{Library Names}, whereby global variable and function names
start with a capital letter.
+Here is a simple test program:
+
address@hidden
+BEGIN @{
+ while ((p = getpwent()) != "")
+ print p
address@hidden
address@hidden example
+
address@hidden
+
+Here's what happens when it's run:
+
address@hidden
+$ @kbd{gawk -f ns_passwd.awk -f testpasswd.awk}
address@hidden root:x:0:0:root:/root:/bin/bash
address@hidden daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
address@hidden bin:x:2:2:bin:/bin:/usr/sbin/nologin
address@hidden sys:x:3:3:sys:/dev:/usr/sbin/nologin
address@hidden
address@hidden example
+
@node Namespace Misc
@section Miscellaneous Notes
address@hidden: Finish revising this material.
+
Other notes for reviewers:
@table @asis
@@ -31487,11 +31592,6 @@ Simply print fully qualified names all the time. Maybe
allow a
namespace and it will use that to create fully qualified names?
Have to be careful about all uppercase names though.
address@hidden How does this affect @code{@@include}?
-Basically @code{@@include} should push and pop the namespace. Each
address@hidden@@include} saves the current namespace and starts over with
-namespace @samp{awk} until an @code{@@namespace} is seen
-(DONE).
@item Extension functions
Revise the current macros to pass @code{"awk"} as the namespace
@@ -31533,47 +31633,6 @@ Should the @code{ext_id}, which is currently just a
null pointer,
be made to point to something? What would be carry around in it?
@end enumerate
address@hidden Additional @command{gawk} built-ins
-Based on some discussion with Andrew Schorr, I'd like to find a way
-to change the additional @command{gawk} built-in functions, like
address@hidden()}, @code{strftime()}, etc. into ``pre-defined''
-extension functions in the @samp{awk} namespace. This has some
-advantages:
-
address@hidden 1
address@hidden
-It gives us room to add more built-ins without they're being reserved
-words to the grammar. This in turn means that:
-
address@hidden
-Users can define their own functions with the same name as @command{gawk}
-additions as long as they put them in their own namespace.
address@hidden enumerate
-
-Everybody wins!
-
-Note that POSIX-standard pre-defined @command{awk} names such as
@command{length()}
-and @command{sub()} would remain reserved. The following would produce
-a syntax error:
-
address@hidden
-@@namespace "example"
-
-function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
-
address@hidden
-Whereas this would not:
-
address@hidden
-@@namespace "example"
-
-function gensub(str, pat, result) @{ @dots{} @}
address@hidden example
-
-One challenge is the @code{snode()} function in @file{awkgram.y} which does
certain ``fix-ups''
-for calls to certain built-in functions, including some of the additional
@command{gawk}-specific ones.
-I still think this is all doable, but it will take some thought.
@end table
@node Arbitrary Precision Arithmetic
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index a835f9e..950500b 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -894,6 +894,8 @@ particular records in a file and perform operations upon
them.
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
+* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
* Computer Arithmetic:: A quick intro to computer math.
@@ -1687,6 +1689,10 @@ messages into different languages at runtime.
@ref{Debugger}, describes the @command{gawk} debugger.
@item
address@hidden, describes how @command{gawk} allows variables and/or
+functions of the same name to be in different namespaces.
+
address@hidden
@ref{Arbitrary Precision Arithmetic},
describes advanced arithmetic facilities.
@@ -3746,6 +3752,9 @@ This option may be given multiple times; the @command{awk}
program consists of the concatenation of the contents of
each specified @var{source-file}.
+Files named with @option{-i} are treated as if they had @samp{@@namespace
"awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@item -v @address@hidden
@itemx --assign @address@hidden
@cindex @option{-v} option
@@ -3903,6 +3912,10 @@ $ @kbd{gawk -e 'BEGIN @{ a = 5 ;' -e 'print a @}'}
@noindent
However, this is no longer true. If you have any scripts that
rely upon this feature, you should revise them.
+
+This is because each @var{program-text} is treated as if it had
address@hidden@@namespace "awk"} at its beginning. @xref{Namespaces}, for more
+information.
@end quotation
@item @option{-E} @var{file}
@@ -3981,6 +3994,9 @@ input. Thus, after processing an @option{-i} argument,
@command{gawk}
still expects to find the main source code via the @option{-f} option
or on the command line.
+Files named with @option{-i} are treated as if they had @samp{@@namespace
"awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@item @option{-l} @var{ext}
@itemx @option{--load} @var{ext}
@cindex @option{-l} option
@@ -4758,6 +4774,10 @@ As mentioned in @ref{AWKPATH Variable}, the current
directory is always
searched first for source files, before searching in @env{AWKPATH};
this also applies to files named with @code{@@include}.
+Finally, files included with @code{@@include}
+are treated as if they had @samp{@@namespace "awk"}
+at their beginning. @xref{Namespaces}, for more information.
+
@node Loading Shared Libraries
@section Loading Dynamic Extensions into Your Program
@@ -30238,6 +30258,7 @@ This @value{CHAPTER} describes a feature that is
specific to @command{gawk}.
* Qualified Names:: How to qualify names with a namespace.
* Default Namespace:: The default namespace.
* Changing The Namespace:: How to change the namespace.
+* Naming Rules:: Namespace and Component Naming Rules.
* Internal Name Management:: How names are stored internally.
* Namespace Example:: An example of code using a namespace.
* Namespace Misc:: Namespace notes for developers.
@@ -30267,46 +30288,32 @@ less chance for collisions.) These facilities are
sometimes referred
to as @dfn{packages} or @dfn{modules}.
Starting with @value{PVERSION} @strong{FIXME} 5.0, @command{gawk} provides a
-mechanism to put functions and global variables into separate namespaces.
+simple mechanism to put functions and global variables into separate
namespaces.
@node Qualified Names
@section Qualified Names
-A @dfn{qualified name} is an identifier that includes a namespace
-name and the namespace separator, @code{::}. For example, one
-might have a function named @code{posix::getpid()}. Here, the
-namespace is @code{posix} and the function name within the namespace
-is @code{getpid()}. The namespace and variable or function name are
-separated by a double-colon. Only one such separator is allowed in a
-qualified name.
+A @dfn{qualified name} is an identifier that includes a namespace name,
+the namespace separator @code{::}, and a component name. For example, one
+might have a function named @code{posix::getpid()}. Here, the namespace
+is @code{posix} and the function name within the namespace (the component)
+is @code{getpid()}. The namespace and component names are separated by
+a double-colon. Only one such separator is allowed in a qualified name.
@quotation NOTE
Unlike C++, the @code{::} is @emph{not} an operator. No spaces are
-allowed between the namespace name, the @code{::}, and the rest of
-the name.
+allowed between the namespace name, the @code{::}, and the component name.
@end quotation
-You must use fully qualified names from one namespace to access variables
+You must use qualified names from one namespace to access variables
and functions in another. This is especially important when using
variable names to index the special @code{SYMTAB} array (@pxref{Auto-set}),
and when making indirect function calls (@pxref{Indirect Calls}).
-It is a fatal error to use any @command{gawk} reserved word (such
-as @code{if} or @code{for}), or the name of any built-in function
-(such as @code{sin()} or @code{gsub()}) as either part of a
-fully qualified address@hidden hope to improve the implementation so
-that this restriction will apply only to standard @command{awk}
-reserved words and built-in functions. In this case, the additional
-built-in functions defined by @command{gawk} will become pre-loaded
-extension functions.}
-
address@hidden pre-defined variable names may be used:
address@hidden::NR} is valid, if possibly not all that useful.
-
@node Default Namespace
@section The Default Namespace
-The default namespace, not surprisingly, is @samp{awk}.
+The default namespace, not surprisingly, is @code{awk}.
All of the predefined @command{awk} and @command{gawk} variables
are in this namespace, and thus have qualified names like
@code{awk::ARGC}, @code{awk::NF}, and so on.
@@ -30314,10 +30321,9 @@ are in this namespace, and thus have qualified names
like
Furthermore, even when you have changed the namespace for your
current source file (@pxref{Changing The Namespace}), @command{gawk}
forces unqualified identifiers whose names are all uppercase letters
-to be in the @samp{awk} namespace. This makes it possible for you to easily
+to be in the @code{awk} namespace. This makes it possible for you to easily
reference @command{gawk}'s global variables from different namespaces.
-
-It is a syntax error to use qualified names for function parameter names.
+It also keeps your code looking natural.
@node Changing The Namespace
@section Changing The Namespace
@@ -30341,9 +30347,9 @@ do it too much.
@quotation NOTE
Association of unqualified identifiers to a namespace is handled while
-your program is being parsed by @command{gawk} and before it starts
-to run. There is no concept of a ``current'' namespace once your program
-starts executing. Be sure you understand this.
address@hidden parses your program, before it starts to run. There is
+no concept of a ``current'' namespace once your program starts executing.
+Be sure you understand this.
@end quotation
Each source file for @option{-i} and @option{-f} starts out with
@@ -30351,19 +30357,93 @@ an implicit @samp{@@namespace "awk"}. Similarly,
each chunk of
command-line code supplied with @option{-e} has such an implicit
initial statement (@pxref{Options}).
+Files included with @code{@@include} (@pxref{Include Files}) ``push'' and
+``pop'' the current namespace. That is, each @code{@@include} saves the
+current namespace and starts over with an implicit @samp{@@namespace
+"awk"} until an explicit @samp{@@namespace} statement is seen.
+When @command{gawk} finishes processing the included file, the saved
+namespace is restored and processing continues where it left off in the
+original file.
+
The use of @samp{@@namespace} has no influence upon the order of execution
of @code{BEGIN}, @code{BEGINFILE}, @code{END}, and @code{ENDFILE} rules.
address@hidden Naming Rules
address@hidden Namespace and Component Naming Rules
+
+A number of rules apply to the namespace and component names, as follows.
+
address@hidden @bullet
address@hidden
+It is a syntax error to use qualified names for function parameter names.
+
address@hidden
+It is a syntax error to use any standard @command{awk} reserved word (such
+as @code{if} or @code{for}), or the name of any standard built-in function
+(such as @code{sin()} or @code{gsub()}) as either part of a qualified name.
+Thus, the following produces a syntax error:
+
address@hidden
+@@namespace "example"
+
+function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
+
address@hidden
+Outside the @code{awk} namespace, the names of the additional @command{gawk}
+built-in functions (such as @code{gensub()} or @code{strftime()}) @emph{may}
+be used as a component name. The same set of names may be used as namespace
+names, although this has the potential to be confusing.
+
address@hidden
+The additional @command{gawk} built-in functions may still be called
+from outside the @code{awk} namespace by qualifying them. For example,
address@hidden::systime()}. Here is a somewhat silly example demonstrating
+this rule and the previous one:
+
address@hidden
+BEGIN @{
+ print "in awk namespace, systime() =", systime()
address@hidden
+
+@@namespace "testing"
+
+function systime()
address@hidden
+ print "in testing namespace, systime() =", awk::systime()
address@hidden
+
+BEGIN @{
+ systime()
address@hidden
address@hidden example
+
address@hidden
+
+When run, it produces output like this:
+
address@hidden
+$ @kbd{gawk -f systime.awk}
address@hidden in awk namespace, systime() = 1500488503
address@hidden in testing namespace, systime() = 1500488503
address@hidden example
+
address@hidden
address@hidden pre-defined variable names may be used:
address@hidden::NR} is valid, if possibly not all that useful.
address@hidden itemize
+
@node Internal Name Management
@section Internal Name Management
-For backwards compatibility, all identifiers in the @samp{awk} namespace
-are stored internally as unadorned identifiers. This is mainly relevant
+For backwards compatibility, all identifiers in the @code{awk} namespace
+are stored internally as unadorned identifiers (that is, without a
+leading @samp{awk::}). This is mainly relevant
when using such identifiers as indices for @code{SYMTAB}, @code{FUNCTAB},
and @code{PROCINFO["identifiers"]} (@pxref{Auto-set}), and for use in
indirect function calls (@pxref{Indirect Calls}).
-In program code, to refer to variables and functions in the @samp{awk}
+In program code, to refer to variables and functions in the @code{awk}
namespace from another namespace, you must still use the @samp{awk::}
prefix. For example:
@@ -30371,7 +30451,7 @@ prefix. For example:
@@namespace "awk" @ii{This is the default namespace}
BEGIN @{
- Title = "My Report" @ii{Fully qualified name is} awk::Title
+ Title = "My Report" @ii{Qualified name is} awk::Title
@}
@@namespace "report" @ii{Now in} report @ii{namespace}
@@ -30387,12 +30467,13 @@ function compute() @ii{This is really}
report::compute()
@section Namespace Example
The following example is a revised version of the suite of routines
-developed in @ref{Passwd Functions}.
+developed in @ref{Passwd Functions}. See there for an explanation
+of how the code works.
The formulation here, due mainly to Andrew Schorr, is rather elegant.
-It places all of the implementation functions and variables in the
address@hidden namespace, while leaving the main interface functions
-in the default @code{awk} namespace.
+All of the implementation functions and variables are in the
address@hidden namespace, whereas the main interface functions are
+defined in the @code{awk} namespace.
@example
@c file eg/lib/ns_passwd.awk
@@ -30481,9 +30562,33 @@ As you can see, this version also follows the
convention mentioned in
@ref{Library Names}, whereby global variable and function names
start with a capital letter.
+Here is a simple test program:
+
address@hidden
+BEGIN @{
+ while ((p = getpwent()) != "")
+ print p
address@hidden
address@hidden example
+
address@hidden
+
+Here's what happens when it's run:
+
address@hidden
+$ @kbd{gawk -f ns_passwd.awk -f testpasswd.awk}
address@hidden root:x:0:0:root:/root:/bin/bash
address@hidden daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
address@hidden bin:x:2:2:bin:/bin:/usr/sbin/nologin
address@hidden sys:x:3:3:sys:/dev:/usr/sbin/nologin
address@hidden
address@hidden example
+
@node Namespace Misc
@section Miscellaneous Notes
address@hidden: Finish revising this material.
+
Other notes for reviewers:
@table @asis
@@ -30501,11 +30606,6 @@ Simply print fully qualified names all the time. Maybe
allow a
namespace and it will use that to create fully qualified names?
Have to be careful about all uppercase names though.
address@hidden How does this affect @code{@@include}?
-Basically @code{@@include} should push and pop the namespace. Each
address@hidden@@include} saves the current namespace and starts over with
-namespace @samp{awk} until an @code{@@namespace} is seen
-(DONE).
@item Extension functions
Revise the current macros to pass @code{"awk"} as the namespace
@@ -30547,47 +30647,6 @@ Should the @code{ext_id}, which is currently just a
null pointer,
be made to point to something? What would be carry around in it?
@end enumerate
address@hidden Additional @command{gawk} built-ins
-Based on some discussion with Andrew Schorr, I'd like to find a way
-to change the additional @command{gawk} built-in functions, like
address@hidden()}, @code{strftime()}, etc. into ``pre-defined''
-extension functions in the @samp{awk} namespace. This has some
-advantages:
-
address@hidden 1
address@hidden
-It gives us room to add more built-ins without they're being reserved
-words to the grammar. This in turn means that:
-
address@hidden
-Users can define their own functions with the same name as @command{gawk}
-additions as long as they put them in their own namespace.
address@hidden enumerate
-
-Everybody wins!
-
-Note that POSIX-standard pre-defined @command{awk} names such as
@command{length()}
-and @command{sub()} would remain reserved. The following would produce
-a syntax error:
-
address@hidden
-@@namespace "example"
-
-function gsub(str, pat, result) @{ @dots{} @}
address@hidden example
-
address@hidden
-Whereas this would not:
-
address@hidden
-@@namespace "example"
-
-function gensub(str, pat, result) @{ @dots{} @}
address@hidden example
-
-One challenge is the @code{snode()} function in @file{awkgram.y} which does
certain ``fix-ups''
-for calls to certain built-in functions, including some of the additional
@command{gawk}-specific ones.
-I still think this is all doable, but it will take some thought.
@end table
@node Arbitrary Precision Arithmetic
-----------------------------------------------------------------------
Summary of changes:
doc/ChangeLog | 5 +
doc/gawk.info | 1599 ++++++++++++++++++++++++++++---------------------------
doc/gawk.texi | 227 +++++---
doc/gawktexi.in | 227 +++++---
4 files changed, 1115 insertions(+), 943 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-2640-g18f6277,
Arnold Robbins <=