[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-4376-ge9653d5
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-4376-ge9653d5 |
Date: |
Mon, 24 May 2021 23:28:12 -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, master has been updated
via e9653d5c96605879069f3ae4dd9aeb7c023b1094 (commit)
via b857b6018963e87caa35e18834d6241770fd4aaa (commit)
via b78840f1aefeb477b598f8e7d375428c4b7b4889 (commit)
via abe6c92b13c72c8e214ce2e4eb6371e2d7948b83 (commit)
via ffef5abf2023140a106fd894565dae1abad77a15 (commit)
via 110e88df64d96ec8d0b9a1eeea0d1d18d1de289f (commit)
via ea33d6487ac96e175507406ed994bb9546a7f3ca (commit)
via a6c152e70ba2b847ea9a5f0229b4ee29ce84724f (commit)
via 4acad864db8a3b54acbe6a6416b7138464f693ce (commit)
via 47f5b43b056dd48a68ca73cce9cfefa287bac005 (commit)
via 706d8274e5144abe1046b231d12c270590c4a374 (commit)
via f2b51c0e01ba4298278c503b763d35660f79cc2a (commit)
via 6d5ca1dac2acd1d4f18c291e35582e5d94e936cb (commit)
via 6fba98cc55aaba2b8819eaaca927c24c480cc332 (commit)
via 2eb0932e9eb3a4a4ff05ab8831d7e89c2d554004 (commit)
via 2b3f002533d3d7e7fa507ab9eb104fbdbcd6271b (commit)
via 6f2c655186b7de2a95cca0403eb899dd2ab27c75 (commit)
via 200c22e0556cdaf381d758304e69807d1b0ceff7 (commit)
via fbda8cdd8e8c5a324f1174b070aa0bdcffc5115d (commit)
via 84b8134d494058582bd65fc02b7630ece90ace63 (commit)
via d73e542791ccb18380cd836b8ea4a4a4b3535538 (commit)
via 3a530fc2d0a257536d67ffa854bc8c3ecf96acb1 (commit)
via 92c5c36bc42aa1ccf6ccc8defc4f372b6de92111 (commit)
via 26cd77bdc2735d62eb664291dc9912dbaaa78c2c (commit)
via 1d13100417c33bb36afae0c5972a456d183f0b49 (commit)
via a74c335ac8fd253f8c67cd4c54adef13dd3c6d73 (commit)
via 0a59aaa174784ed6ef7166332670b860ee8054bb (commit)
via 752de8b1a557d3ff7f7c1e3c17104fa165b4c6ca (commit)
via 0802d97db48425045eac9f2dd7748c3ee3802b65 (commit)
via 1453c73c5c71d92aad0e2412f8098cf667ff4200 (commit)
via 4ee6a6599fede9edeab525813d834a5f9d241391 (commit)
via 1f10523de0fc469f0604f5642562f92da608311d (commit)
via a028ecdab76a663e0b12308e2cf9147f38dba6d2 (commit)
via 1a870d555701173c45855ce5023a550dc9f0ee00 (commit)
via 7dbf096579d7f17aaf8618518cc456bbaf6ad22b (commit)
via 2c53d8349f3e5abdbbcd8168ac284c5989b4f444 (commit)
via 5887e22adfed809e482da3a6f5b2f37901915aff (commit)
via 4561382e8ee7cb0ca0f03e817467973d428260b3 (commit)
via edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49 (commit)
via f021dfc21ac0a96270afbdcf9498b14e95619e6f (commit)
via 1fc3d1cbc5c31ecd7b232e8845530ce6a6760986 (commit)
via efc5713d00a0019eb33c8a61c8a5514da7fa303e (commit)
via 81530542f62a575e3857f3a8847c886ee68f9d83 (commit)
via 96b65e953d309fb00cc48b3883fc5805898e57e1 (commit)
via e1b7b04b63a83913f62e4bfff645b940eacf7803 (commit)
via 40cd3b0df6128e5b111c9b7c5c9892eac13a3497 (commit)
via a98f6b507ed2d540ee214cf1f9eb3487a542fd18 (commit)
via 5fd7d2faf13484c595f7cd74468711282816796d (commit)
via b9931e852ba21180c380639135f96cdcd0a3015f (commit)
from 3c0dc846c3982a150b88021224cc4e17640c3b03 (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=e9653d5c96605879069f3ae4dd9aeb7c023b1094
commit e9653d5c96605879069f3ae4dd9aeb7c023b1094
Merge: b857b60 3c0dc84
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri May 21 15:11:42 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b857b6018963e87caa35e18834d6241770fd4aaa
commit b857b6018963e87caa35e18834d6241770fd4aaa
Merge: b78840f 7d35a66
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue May 18 21:09:53 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b78840f1aefeb477b598f8e7d375428c4b7b4889
commit b78840f1aefeb477b598f8e7d375428c4b7b4889
Merge: abe6c92 356f7fb
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu May 13 16:52:23 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=abe6c92b13c72c8e214ce2e4eb6371e2d7948b83
commit abe6c92b13c72c8e214ce2e4eb6371e2d7948b83
Merge: ffef5ab 06cbdb5
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 12 10:38:59 2021 +0300
Merge branch 'master' into feature/bool
diff --cc pc/Makefile.tst
index ea4ec15,50bcf8e..2b49599
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@@ -2587,14 -2587,9 +2587,14 @@@ arraytype
then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
+asortbool:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
backw:
- @echo Expect $@ to fail with DJGPP.
@echo $@
+ @echo Expect $@ to fail with DJGPP.
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ffef5abf2023140a106fd894565dae1abad77a15
commit ffef5abf2023140a106fd894565dae1abad77a15
Merge: 110e88d 229c965
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon May 10 21:36:23 2021 +0300
Merge branch 'master' into feature/bool
diff --cc pc/Makefile.tst
index 8999781,7bab0e3..ea4ec15
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@@ -2586,14 -2587,9 +2587,14 @@@ arraytype
then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
+asortbool:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
backw:
- @echo $@
@echo Expect $@ to fail with DJGPP.
+ @echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=110e88df64d96ec8d0b9a1eeea0d1d18d1de289f
commit 110e88df64d96ec8d0b9a1eeea0d1d18d1de289f
Merge: ea33d64 aa6a71c
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri May 7 13:47:29 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ea33d6487ac96e175507406ed994bb9546a7f3ca
commit ea33d6487ac96e175507406ed994bb9546a7f3ca
Merge: a6c152e 49f12cf
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri May 7 09:20:19 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a6c152e70ba2b847ea9a5f0229b4ee29ce84724f
commit a6c152e70ba2b847ea9a5f0229b4ee29ce84724f
Merge: 4acad86 5e3eb6d
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 5 21:51:19 2021 +0300
Merge branch 'master' into feature/bool
diff --cc NEWS
index 0812f77,4dbcc2a..a61e325
--- a/NEWS
+++ b/NEWS
@@@ -15,12 -15,9 +15,15 @@@ regular numbers; it should not be notic
2. If the AWK_HASH environment variable is set to "fnv1a" gawk will
use the FNV1-A hash function for associative arrays.
- 3. There is now a new function, mkbool(), that creates Boolean-typed
+ 3. The CMake infrastructure has been removed. In the five years it was in
+ the tree, nobody used it, and it was not updated.
+
++4. There is now a new function, mkbool(), that creates Boolean-typed
+values. These values *are* numbers, but they are also tagged as
+Boolean. This is mainly for use with data exchange to/from languages
+or environments that support real Boolean values. See the manual
+for details.
+
Changes from 5.1.0 to 5.1.1
---------------------------
diff --cc doc/ChangeLog
index 3fd6946,f1974a2..d795d09
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@@ -1,33 -1,7 +1,37 @@@
2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+ * CMakeLists.txt: Removed.
+
++2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
++
+ * gawktexi.in: Typo fix.
+
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in, gawk.1, awkcard.in: Renamed bool to mkbool.
+
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Revise doc for bools; they're now just numbers
+ with an extra flag.
+ * gawk.1: Ditto.
+ * awkcard.in: Ditto.
+
+2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Controlling Scanning): Document bools for
+ "@val_type_asc".
+ * awkcard.in: Add doc on bool() function.
+
+2021-04-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Finish documenting bool features.
+ * gawk.1: Add minimal documentation on bool.
+
+2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Start documenting bool features.
+
2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Update menues.
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4acad864db8a3b54acbe6a6416b7138464f693ce
commit 4acad864db8a3b54acbe6a6416b7138464f693ce
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 5 21:44:26 2021 +0300
Small fixes.
diff --git a/ChangeLog b/ChangeLog
index fe4b1a1..f5ab1b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,11 @@
* Makefile.am (EXTRA_DIST): Remove files that are now in build-aux.
+ Unrelated:
+
+ * builtin.c (do_sub): Remove check for BOOL as target. It's not
+ correct anymore.
+
2021-05-03 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (flags2str): Move BOOL entry into the right place in the
@@ -69,7 +74,7 @@
2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
* gawk_api.h (gawk_api_minor_version): Increase to 2.
- * gawk_api.c (+assign_bool): New function.
+ * gawk_api.c (assign_bool): New function.
(node_to_awk_value): Finish updating for bool types and values.
2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/builtin.c b/builtin.c
index afdb747..ff4a53a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2924,10 +2924,6 @@ do_sub(int nargs, unsigned int flags)
}
}
- if ((target->flags & BOOL) != 0)
- fatal(_("%s: target cannot be of type bool"),
- (flags & GSUB) != 0 ? "gsub" : "sub");
-
global = (how_many == -1);
rep_node = POP_STRING(); /* replacement text */
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 151b03f..3fd6946 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Typo fix.
+
2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in, gawk.1, awkcard.in: Renamed bool to mkbool.
diff --git a/doc/gawk.info b/doc/gawk.info
index 824d78e..115a43e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12850,7 +12850,7 @@ File: gawk.info, Node: Boolean Functions, Next:
Numeric Functions, Prev: Call
This function is specific to 'gawk'. It is not available in
compatibility mode (*note Options::):
-'bmkool(EXPRESSION)'
+'mkbool(EXPRESSION)'
Return a Boolean-typed value based on the regular Boolean value of
EXPRESSION. Boolean "true" values have numeric value one. Boolean
"false" values have numeric zero. This is discussed in more detail
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 8992166..267d59f 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18390,7 +18390,7 @@ available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
-@item @code{bmkool(@var{expression})}
+@item @code{mkbool(@var{expression})}
@cindexgawkfunc{mkbool}
Return a Boolean-typed value based on the regular Boolean value
of @var{expression}. Boolean ``true'' values have numeric value one.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 75607b2..234ba78 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17531,7 +17531,7 @@ available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
-@item @code{bmkool(@var{expression})}
+@item @code{mkbool(@var{expression})}
@cindexgawkfunc{mkbool}
Return a Boolean-typed value based on the regular Boolean value
of @var{expression}. Boolean ``true'' values have numeric value one.
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=47f5b43b056dd48a68ca73cce9cfefa287bac005
commit 47f5b43b056dd48a68ca73cce9cfefa287bac005
Merge: 706d827 7897b02
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 5 21:38:42 2021 +0300
Merge branch 'master' into feature/bool
diff --cc ChangeLog
index 4152bdd,0cec3ee..fe4b1a1
--- a/ChangeLog
+++ b/ChangeLog
@@@ -5,38 -5,10 +5,42 @@@
* configure.ac (AM_INIT_AUTOMAKE): Add subdir-objects option.
* NEWS: Updated.
+ Get `make distcheck' working again:
+
+ * Makefile.am (EXTRA_DIST): Remove files that are now in build-aux.
+
+2021-05-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (flags2str): Move BOOL entry into the right place in the
+ list.
+ * NEWS: Update with info on mkbool.
+
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (do_bool): Renamed do_mkbool.
+ * awkgram.y (tokentab): Rename bool to mkbool.
+ * builtin.c (do_bool): Renamed do_mkbool.
+
+2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (boolval): Remove check for BOOL flag. It was incorrect.
+ Thanks to Andrew Schorr for the catch.
+ For Node_val, update the comment to describe the BOOL flag, and
+ move BOOL up to be alongside the flags for Node_val.
+
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make bools plain numbers that have bool flag instead of
+ being weird string values.
+
+ * array.c (do_sort_up_value_type): Remove special ordering
+ for booleans.
+ * awk.h (warn_bool): Remove declaration.
+ * builtin.c (warn_bool): Remove function and all calls.
+ * gawkapi.c (node_to_awk_value): Update switches to look for
+ NUMBER|BOOL.
+ * node.c (make_bool_node): Revise string values and flag bits.
+
2021-04-16 Arnold D. Robbins <arnold@skeeve.com>
* main (arg_assign): For -v '@/...' make sure that there are
diff --cc extension/ChangeLog
index 986a835,9b1060e..7614fd1
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@@ -1,8 -1,10 +1,15 @@@
+ 2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Get `make distcheck' working again:
+
+ * Makefile.am (EXTRA_DIST): Remove files that are now in build-aux.
+ * aclocal.m4: Regenerated.
+
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray.c (write_value): Add support for writing boolean values.
+ (read_value): Ditto.
+
2021-03-29 Arnold D. Robbins <arnold@skeeve.com>
* testext.c (var_test): Fix a comment. Update copyright year.
diff --cc pc/ChangeLog
index 51b367d,37821c6..65db8ac
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@@ -1,7 -1,8 +1,12 @@@
+ 2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Rebuilt.
+ * config.h: Rebuilt.
+
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Rebuilt.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Rebuilt.
diff --cc test/ChangeLog
index 7198c0f,d3e866a..902a8f9
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@@ -1,13 -1,9 +1,19 @@@
+ 2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (iolint): Fix for out-of-tree builds.
+ (testext): Ditto
+ * iolint.ok: Updated.
+
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * asortbool.awk, functab5.ok, id.ok, rwarrray.awk,
+ symtab11.ok: Revise after code changes.
+
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * asortbool.ok: Revise after code changes.
+ * rwarray.awk: Ditto.
+
2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
* noeffect.awk: Add more test cases. Thanks to Wolfgang Laun
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=706d8274e5144abe1046b231d12c270590c4a374
commit 706d8274e5144abe1046b231d12c270590c4a374
Merge: f2b51c0 48b6b85
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 5 20:45:05 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f2b51c0e01ba4298278c503b763d35660f79cc2a
commit f2b51c0e01ba4298278c503b763d35660f79cc2a
Merge: 6d5ca1d e52b77b
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed May 5 20:42:50 2021 +0300
Merge branch 'master' into feature/bool
diff --cc ChangeLog
index 5f76ba5,688f8be..4152bdd
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,35 -1,10 +1,42 @@@
+ 2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Move to Automake 1.16.3.
+
+ * configure.ac (AM_INIT_AUTOMAKE): Add subdir-objects option.
+ * NEWS: Updated.
+
+2021-05-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (flags2str): Move BOOL entry into the right place in the
+ list.
+ * NEWS: Update with info on mkbool.
+
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (do_bool): Renamed do_mkbool.
+ * awkgram.y (tokentab): Rename bool to mkbool.
+ * builtin.c (do_bool): Renamed do_mkbool.
+
+2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (boolval): Remove check for BOOL flag. It was incorrect.
+ Thanks to Andrew Schorr for the catch.
+ For Node_val, update the comment to describe the BOOL flag, and
+ move BOOL up to be alongside the flags for Node_val.
+
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make bools plain numbers that have bool flag instead of
+ being weird string values.
+
+ * array.c (do_sort_up_value_type): Remove special ordering
+ for booleans.
+ * awk.h (warn_bool): Remove declaration.
+ * builtin.c (warn_bool): Remove function and all calls.
+ * gawkapi.c (node_to_awk_value): Update switches to look for
+ NUMBER|BOOL.
+ * node.c (make_bool_node): Revise string values and flag bits.
+
2021-04-16 Arnold D. Robbins <arnold@skeeve.com>
* main (arg_assign): For -v '@/...' make sure that there are
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6d5ca1dac2acd1d4f18c291e35582e5d94e936cb
commit 6d5ca1dac2acd1d4f18c291e35582e5d94e936cb
Merge: 6fba98c 85841e0
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue May 4 09:38:16 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6fba98cc55aaba2b8819eaaca927c24c480cc332
commit 6fba98cc55aaba2b8819eaaca927c24c480cc332
Merge: 2eb0932 6f2c655
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon May 3 20:35:04 2021 +0300
Merge branch 'feature/bool' of ssh://git.sv.gnu.org/srv/git/gawk into
feature/bool
diff --cc ChangeLog
index 7dbafcd,679d70a..688dd9b
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,9 -1,9 +1,15 @@@
+2021-05-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (flags2str): Move BOOL entry into the right place in the
+ list.
+ * NEWS: Update with info on mkbool.
+
+ 2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (do_bool): Renamed do_mkbool.
+ * awkgram.y (tokentab): Rename bool to mkbool.
+ * builtin.c (do_bool): Renamed do_mkbool.
+
2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (boolval): Remove check for BOOL flag. It was incorrect.
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2eb0932e9eb3a4a4ff05ab8831d7e89c2d554004
commit 2eb0932e9eb3a4a4ff05ab8831d7e89c2d554004
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon May 3 20:34:19 2021 +0300
Doc updates.
diff --git a/ChangeLog b/ChangeLog
index 8ed5b02..7dbafcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* eval.c (flags2str): Move BOOL entry into the right place in the
list.
+ * NEWS: Update with info on mkbool.
2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/NEWS b/NEWS
index 8506221..4708cf2 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,12 @@ regular numbers; it should not be noticeable most of the
time.
2. If the AWK_HASH environment variable is set to "fnv1a" gawk will
use the FNV1-A hash function for associative arrays.
+3. There is now a new function, mkbool(), that creates Boolean-typed
+values. These values *are* numbers, but they are also tagged as
+Boolean. This is mainly for use with data exchange to/from languages
+or environments that support real Boolean values. See the manual
+for details.
+
Changes from 5.1.0 to 5.1.1
---------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2b3f002533d3d7e7fa507ab9eb104fbdbcd6271b
commit 2b3f002533d3d7e7fa507ab9eb104fbdbcd6271b
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon May 3 20:33:49 2021 +0300
Small fix in eval.c.
diff --git a/ChangeLog b/ChangeLog
index 5e2e98e..8ed5b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (flags2str): Move BOOL entry into the right place in the
+ list.
+
2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (boolval): Remove check for BOOL flag. It was incorrect.
diff --git a/eval.c b/eval.c
index 75c3932..c1d544c 100644
--- a/eval.c
+++ b/eval.c
@@ -442,6 +442,7 @@ flags2str(int flagval)
{ NUMCUR, "NUMCUR" },
{ NUMBER, "NUMBER" },
{ USER_INPUT, "USER_INPUT" },
+ { BOOL, "BOOL" },
{ INTLSTR, "INTLSTR" },
{ NUMINT, "NUMINT" },
{ INTIND, "INTIND" },
@@ -455,7 +456,6 @@ flags2str(int flagval)
{ XARRAY, "XARRAY" },
{ NUMCONSTSTR, "NUMCONSTSTR" },
{ REGEX, "REGEX" },
- { BOOL, "BOOL" },
{ 0, NULL },
};
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6f2c655186b7de2a95cca0403eb899dd2ab27c75
commit 6f2c655186b7de2a95cca0403eb899dd2ab27c75
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun May 2 08:25:28 2021 +0300
Renamed bool() to mkbool().
diff --git a/ChangeLog b/ChangeLog
index 5e2e98e..679d70a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (do_bool): Renamed do_mkbool.
+ * awkgram.y (tokentab): Rename bool to mkbool.
+ * builtin.c (do_bool): Renamed do_mkbool.
+
2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (boolval): Remove check for BOOL flag. It was incorrect.
diff --git a/awk.h b/awk.h
index 57dae1e..6a9a8ac 100644
--- a/awk.h
+++ b/awk.h
@@ -1508,7 +1508,7 @@ extern int strncasecmpmbs(const unsigned char *,
const unsigned char *, size_t);
extern int sanitize_exit_status(int status);
extern void check_symtab_functab(NODE *dest, const char *fname, const char
*msg);
-extern NODE *do_bool(int nargs);
+extern NODE *do_mkbool(int nargs);
/* debug.c */
extern void init_debug(void);
extern int debug_prog(INSTRUCTION *pc);
diff --git a/awkgram.c b/awkgram.c
index cda3cac..78cb366 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4779,7 +4779,6 @@ static const struct token tokentab[] = {
{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3),
do_asorti, 0},
{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2,
MPF(atan2)},
{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2),
do_bindtextdomain, 0},
-{"bool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_bool,
0},
{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2),
do_close, 0},
@@ -4816,6 +4815,7 @@ static const struct token tokentab[] = {
{"log", Op_builtin, LEX_BUILTIN, A(1), do_log,
MPF(log)},
{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift,
MPF(lshift)},
{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match,
0},
+{"mkbool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mkbool,
0},
{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_mktime, 0},
{"namespace", Op_symbol, LEX_NAMESPACE, GAWKX, 0,
0},
{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
diff --git a/awkgram.y b/awkgram.y
index d705caf..5ff3a79 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -2277,7 +2277,6 @@ static const struct token tokentab[] = {
{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3),
do_asorti, 0},
{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2,
MPF(atan2)},
{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2),
do_bindtextdomain, 0},
-{"bool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_bool,
0},
{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2),
do_close, 0},
@@ -2314,6 +2313,7 @@ static const struct token tokentab[] = {
{"log", Op_builtin, LEX_BUILTIN, A(1), do_log,
MPF(log)},
{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift,
MPF(lshift)},
{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match,
0},
+{"mkbool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mkbool,
0},
{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_mktime, 0},
{"namespace", Op_symbol, LEX_NAMESPACE, GAWKX, 0,
0},
{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
diff --git a/builtin.c b/builtin.c
index d56d783..afdb747 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4329,10 +4329,10 @@ check_symtab_functab(NODE *dest, const char *fname,
const char *msg)
fatal(msg, fname, "FUNCTAB");
}
-/* do_bool --- create boolean values */
+/* do_mkbool --- create boolean values */
NODE *
-do_bool(int nargs)
+do_mkbool(int nargs)
{
NODE *tmp;
bool result;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 011a0bc..151b03f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in, gawk.1, awkcard.in: Renamed bool to mkbool.
+
2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Revise doc for bools; they're now just numbers
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 0229e18..659a4a7 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1921,7 +1921,7 @@ See the manual for details.\*(CB
.fi
.in +.2i
.ti -.2i
-\*(CD\*(FCbool(\*(FIexpression\*(FC)\*(FR
+\*(CD\*(FCmkbool(\*(FIexpression\*(FC)\*(FR
.br
Return a Boolean-typed value based on the Boolean value
of \*(FIexpression\fP. True values have a numeric value of one.
diff --git a/doc/gawk.1 b/doc/gawk.1
index e71ceba..1c382c1 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 28 2021" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "May 02 2021" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -3484,7 +3484,7 @@ if you want to use the current domain.
You can create special Boolean-typed values; see the manual for how
they work and why they exist.
.TP
-.BI bool( expression\^ )
+.BI mkbool( expression\^ )
Based on the boolean value of
.I expression
return either a true value or a false value.
diff --git a/doc/gawk.info b/doc/gawk.info
index b73b18e..824d78e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12850,7 +12850,7 @@ File: gawk.info, Node: Boolean Functions, Next:
Numeric Functions, Prev: Call
This function is specific to 'gawk'. It is not available in
compatibility mode (*note Options::):
-'bool(EXPRESSION)'
+'bmkool(EXPRESSION)'
Return a Boolean-typed value based on the regular Boolean value of
EXPRESSION. Boolean "true" values have numeric value one. Boolean
"false" values have numeric zero. This is discussed in more detail
@@ -20970,8 +20970,8 @@ extension provided by the 'gawkextlib' project
it was originally Boolean is lost. Exporting data is even harder;
there's no way to indicate that a value is really Boolean.
- To solve this problem, 'gawk' provides a function named 'bool()'. It
-takes one argument, which is any 'awk' expression, and it returns a
+ To solve this problem, 'gawk' provides a function named 'mkbool()'.
+It takes one argument, which is any 'awk' expression, and it returns a
value of Boolean type.
The returned values are normal 'awk' numeric values, with values of
@@ -20989,7 +20989,7 @@ desired.
of Boolean type named 'TRUE' and 'FALSE', doing so would undoubtedly
have broken many existing 'awk' programs. Instead, having a "generator"
function that creates Boolean values gives flexibility, without breaking
-any existing code.
+as much existing code.
File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Boolean
Typed Values, Up: Advanced Features
@@ -35384,7 +35384,6 @@ Index
* bitwise, XOR: Bitwise Functions. (line 57)
* body, in actions: Statements. (line 10)
* body, in loops: While Statement. (line 14)
-* bool: Boolean Functions. (line 10)
* Boolean expressions: Boolean Ops. (line 6)
* Boolean expressions, as patterns: Expression Patterns. (line 39)
* boolean function: Boolean Functions. (line 6)
@@ -36976,6 +36975,7 @@ Index
* metacharacters, escape sequences for: Escape Sequences. (line 140)
* metacharacters, in regular expressions: Regexp Operators. (line 6)
* minimum precision required by MPFR library: Auto-set. (line 279)
+* mkbool: Boolean Functions. (line 10)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* module, definition of: Global Namespace. (line 18)
@@ -38436,364 +38436,364 @@ Node: Functions540711
Node: Built-in541749
Node: Calling Built-in542902
Node: Boolean Functions544898
-Node: Numeric Functions545450
-Ref: Numeric Functions-Footnote-1549477
-Ref: Numeric Functions-Footnote-2550125
-Ref: Numeric Functions-Footnote-3550173
-Node: String Functions550445
-Ref: String Functions-Footnote-1574586
-Ref: String Functions-Footnote-2574714
-Ref: String Functions-Footnote-3574962
-Node: Gory Details575049
-Ref: table-sub-escapes576840
-Ref: table-sub-proposed578359
-Ref: table-posix-sub579722
-Ref: table-gensub-escapes581263
-Ref: Gory Details-Footnote-1582086
-Node: I/O Functions582240
-Ref: table-system-return-values588694
-Ref: I/O Functions-Footnote-1590774
-Ref: I/O Functions-Footnote-2590922
-Node: Time Functions591042
-Ref: Time Functions-Footnote-1601713
-Ref: Time Functions-Footnote-2601781
-Ref: Time Functions-Footnote-3601939
-Ref: Time Functions-Footnote-4602050
-Ref: Time Functions-Footnote-5602162
-Ref: Time Functions-Footnote-6602389
-Node: Bitwise Functions602655
-Ref: table-bitwise-ops603249
-Ref: Bitwise Functions-Footnote-1609312
-Ref: Bitwise Functions-Footnote-2609485
-Node: Type Functions609676
-Node: I18N Functions612630
-Node: User-defined614281
-Node: Definition Syntax615093
-Ref: Definition Syntax-Footnote-1620787
-Node: Function Example620858
-Ref: Function Example-Footnote-1623780
-Node: Function Calling623802
-Node: Calling A Function624390
-Node: Variable Scope625348
-Node: Pass By Value/Reference628342
-Node: Function Caveats630986
-Ref: Function Caveats-Footnote-1633033
-Node: Return Statement633153
-Node: Dynamic Typing636132
-Node: Indirect Calls637062
-Ref: Indirect Calls-Footnote-1647317
-Node: Functions Summary647445
-Node: Library Functions650150
-Ref: Library Functions-Footnote-1653757
-Ref: Library Functions-Footnote-2653900
-Node: Library Names654071
-Ref: Library Names-Footnote-1657738
-Ref: Library Names-Footnote-2657961
-Node: General Functions658047
-Node: Strtonum Function659150
-Node: Assert Function662172
-Node: Round Function665498
-Node: Cliff Random Function667038
-Node: Ordinal Functions668054
-Ref: Ordinal Functions-Footnote-1671117
-Ref: Ordinal Functions-Footnote-2671369
-Node: Join Function671579
-Ref: Join Function-Footnote-1673349
-Node: Getlocaltime Function673549
-Node: Readfile Function677291
-Node: Shell Quoting679268
-Node: Data File Management680669
-Node: Filetrans Function681301
-Node: Rewind Function685397
-Node: File Checking687306
-Ref: File Checking-Footnote-1688640
-Node: Empty Files688841
-Node: Ignoring Assigns690820
-Node: Getopt Function692370
-Ref: Getopt Function-Footnote-1707581
-Node: Passwd Functions707781
-Ref: Passwd Functions-Footnote-1716620
-Node: Group Functions716708
-Ref: Group Functions-Footnote-1724606
-Node: Walking Arrays724813
-Node: Library Functions Summary727821
-Node: Library Exercises729227
-Node: Sample Programs729692
-Node: Running Examples730462
-Node: Clones731190
-Node: Cut Program732414
-Node: Egrep Program742554
-Node: Id Program751555
-Node: Split Program761502
-Ref: Split Program-Footnote-1771392
-Node: Tee Program771565
-Node: Uniq Program774355
-Node: Wc Program781943
-Node: Bytes vs. Characters782330
-Node: Using extensions783878
-Node: wc program784632
-Node: Miscellaneous Programs789497
-Node: Dupword Program790710
-Node: Alarm Program792740
-Node: Translate Program797595
-Ref: Translate Program-Footnote-1802160
-Node: Labels Program802430
-Ref: Labels Program-Footnote-1805781
-Node: Word Sorting805865
-Node: History Sorting809937
-Node: Extract Program812162
-Node: Simple Sed820216
-Node: Igawk Program823290
-Ref: Igawk Program-Footnote-1837621
-Ref: Igawk Program-Footnote-2837823
-Ref: Igawk Program-Footnote-3837945
-Node: Anagram Program838060
-Node: Signature Program841122
-Node: Programs Summary842369
-Node: Programs Exercises843583
-Ref: Programs Exercises-Footnote-1847713
-Node: Advanced Features847799
-Node: Nondecimal Data849930
-Node: Boolean Typed Values851528
-Node: Array Sorting853402
-Node: Controlling Array Traversal854107
-Ref: Controlling Array Traversal-Footnote-1862475
-Node: Array Sorting Functions862593
-Ref: Array Sorting Functions-Footnote-1867684
-Node: Two-way I/O867880
-Ref: Two-way I/O-Footnote-1875601
-Ref: Two-way I/O-Footnote-2875788
-Node: TCP/IP Networking875870
-Node: Profiling878988
-Node: Extension Philosophy888297
-Node: Advanced Features Summary889776
-Node: Internationalization891791
-Node: I18N and L10N893271
-Node: Explaining gettext893958
-Ref: Explaining gettext-Footnote-1899850
-Ref: Explaining gettext-Footnote-2900035
-Node: Programmer i18n900200
-Ref: Programmer i18n-Footnote-1905149
-Node: Translator i18n905198
-Node: String Extraction905992
-Ref: String Extraction-Footnote-1907124
-Node: Printf Ordering907210
-Ref: Printf Ordering-Footnote-1909996
-Node: I18N Portability910060
-Ref: I18N Portability-Footnote-1912516
-Node: I18N Example912579
-Ref: I18N Example-Footnote-1915854
-Ref: I18N Example-Footnote-2915927
-Node: Gawk I18N916036
-Node: I18N Summary916685
-Node: Debugger918026
-Node: Debugging919026
-Node: Debugging Concepts919467
-Node: Debugging Terms921276
-Node: Awk Debugging923851
-Ref: Awk Debugging-Footnote-1924796
-Node: Sample Debugging Session924928
-Node: Debugger Invocation925462
-Node: Finding The Bug926848
-Node: List of Debugger Commands933322
-Node: Breakpoint Control934655
-Node: Debugger Execution Control938349
-Node: Viewing And Changing Data941711
-Node: Execution Stack945252
-Node: Debugger Info946889
-Node: Miscellaneous Debugger Commands950960
-Node: Readline Support956022
-Node: Limitations956918
-Node: Debugging Summary959472
-Node: Namespaces960751
-Node: Global Namespace961862
-Node: Qualified Names963260
-Node: Default Namespace964259
-Node: Changing The Namespace965000
-Node: Naming Rules966614
-Node: Internal Name Management968462
-Node: Namespace Example969504
-Node: Namespace And Features972066
-Node: Namespace Summary973501
-Node: Arbitrary Precision Arithmetic974978
-Node: Computer Arithmetic976465
-Ref: table-numeric-ranges980231
-Ref: table-floating-point-ranges980724
-Ref: Computer Arithmetic-Footnote-1981382
-Node: Math Definitions981439
-Ref: table-ieee-formats984415
-Node: MPFR features984982
-Node: FP Math Caution986700
-Ref: FP Math Caution-Footnote-1987772
-Node: Inexactness of computations988141
-Node: Inexact representation989172
-Node: Comparing FP Values990532
-Node: Errors accumulate991773
-Node: Strange values993229
-Ref: Strange values-Footnote-1995817
-Node: Getting Accuracy995922
-Node: Try To Round998632
-Node: Setting precision999531
-Ref: table-predefined-precision-strings1000228
-Node: Setting the rounding mode1002058
-Ref: table-gawk-rounding-modes1002432
-Ref: Setting the rounding mode-Footnote-11006363
-Node: Arbitrary Precision Integers1006542
-Ref: Arbitrary Precision Integers-Footnote-11009717
-Node: Checking for MPFR1009866
-Node: POSIX Floating Point Problems1011340
-Ref: POSIX Floating Point Problems-Footnote-11015625
-Node: Floating point summary1015663
-Node: Dynamic Extensions1017853
-Node: Extension Intro1019406
-Node: Plugin License1020672
-Node: Extension Mechanism Outline1021469
-Ref: figure-load-extension1021908
-Ref: figure-register-new-function1023473
-Ref: figure-call-new-function1024565
-Node: Extension API Description1026627
-Node: Extension API Functions Introduction1028340
-Ref: table-api-std-headers1030176
-Node: General Data Types1034425
-Ref: General Data Types-Footnote-11043131
-Node: Memory Allocation Functions1043430
-Ref: Memory Allocation Functions-Footnote-11047931
-Node: Constructor Functions1048030
-Node: API Ownership of MPFR and GMP Values1051683
-Node: Registration Functions1052996
-Node: Extension Functions1053696
-Node: Exit Callback Functions1059018
-Node: Extension Version String1060268
-Node: Input Parsers1060931
-Node: Output Wrappers1073652
-Node: Two-way processors1078164
-Node: Printing Messages1080429
-Ref: Printing Messages-Footnote-11081600
-Node: Updating ERRNO1081753
-Node: Requesting Values1082492
-Ref: table-value-types-returned1083229
-Node: Accessing Parameters1084337
-Node: Symbol Table Access1085574
-Node: Symbol table by name1086086
-Ref: Symbol table by name-Footnote-11089110
-Node: Symbol table by cookie1089238
-Ref: Symbol table by cookie-Footnote-11093423
-Node: Cached values1093487
-Ref: Cached values-Footnote-11097023
-Node: Array Manipulation1097176
-Ref: Array Manipulation-Footnote-11098267
-Node: Array Data Types1098304
-Ref: Array Data Types-Footnote-11100962
-Node: Array Functions1101054
-Node: Flattening Arrays1105552
-Node: Creating Arrays1112528
-Node: Redirection API1117295
-Node: Extension API Variables1120128
-Node: Extension Versioning1120839
-Ref: gawk-api-version1121268
-Node: Extension GMP/MPFR Versioning1122999
-Node: Extension API Informational Variables1124627
-Node: Extension API Boilerplate1125700
-Node: Changes from API V11129674
-Node: Finding Extensions1131246
-Node: Extension Example1131805
-Node: Internal File Description1132603
-Node: Internal File Ops1136683
-Ref: Internal File Ops-Footnote-11148033
-Node: Using Internal File Ops1148173
-Ref: Using Internal File Ops-Footnote-11150556
-Node: Extension Samples1150830
-Node: Extension Sample File Functions1152359
-Node: Extension Sample Fnmatch1160008
-Node: Extension Sample Fork1161495
-Node: Extension Sample Inplace1162713
-Node: Extension Sample Ord1166339
-Node: Extension Sample Readdir1167175
-Ref: table-readdir-file-types1168064
-Node: Extension Sample Revout1169131
-Node: Extension Sample Rev2way1169720
-Node: Extension Sample Read write array1170460
-Node: Extension Sample Readfile1172402
-Node: Extension Sample Time1173497
-Node: Extension Sample API Tests1175249
-Node: gawkextlib1175741
-Node: Extension summary1178659
-Node: Extension Exercises1182361
-Node: Language History1183603
-Node: V7/SVR3.11185259
-Node: SVR41187411
-Node: POSIX1188845
-Node: BTL1190226
-Node: POSIX/GNU1190955
-Node: Feature History1196733
-Node: Common Extensions1213052
-Node: Ranges and Locales1214335
-Ref: Ranges and Locales-Footnote-11218951
-Ref: Ranges and Locales-Footnote-21218978
-Ref: Ranges and Locales-Footnote-31219213
-Node: Contributors1219436
-Node: History summary1225433
-Node: Installation1226813
-Node: Gawk Distribution1227757
-Node: Getting1228241
-Node: Extracting1229204
-Node: Distribution contents1230842
-Node: Unix Installation1237322
-Node: Quick Installation1238004
-Node: Shell Startup Files1240418
-Node: Additional Configuration Options1241507
-Node: Configuration Philosophy1243822
-Node: Non-Unix Installation1246191
-Node: PC Installation1246651
-Node: PC Binary Installation1247489
-Node: PC Compiling1247924
-Node: PC Using1249041
-Node: Cygwin1252594
-Node: MSYS1253818
-Node: VMS Installation1254420
-Node: VMS Compilation1255211
-Ref: VMS Compilation-Footnote-11256440
-Node: VMS Dynamic Extensions1256498
-Node: VMS Installation Details1258183
-Node: VMS Running1260436
-Node: VMS GNV1264715
-Node: VMS Old Gawk1265450
-Node: Bugs1265921
-Node: Bug address1266584
-Node: Usenet1269566
-Node: Maintainers1270570
-Node: Other Versions1271755
-Node: Installation summary1279620
-Node: Notes1280829
-Node: Compatibility Mode1281623
-Node: Additions1282405
-Node: Accessing The Source1283330
-Node: Adding Code1284767
-Node: New Ports1290986
-Node: Derived Files1295361
-Ref: Derived Files-Footnote-11301021
-Ref: Derived Files-Footnote-21301056
-Ref: Derived Files-Footnote-31301654
-Node: Future Extensions1301768
-Node: Implementation Limitations1302426
-Node: Extension Design1303636
-Node: Old Extension Problems1304780
-Ref: Old Extension Problems-Footnote-11306298
-Node: Extension New Mechanism Goals1306355
-Ref: Extension New Mechanism Goals-Footnote-11309719
-Node: Extension Other Design Decisions1309908
-Node: Extension Future Growth1312021
-Node: Notes summary1312627
-Node: Basic Concepts1313785
-Node: Basic High Level1314466
-Ref: figure-general-flow1314748
-Ref: figure-process-flow1315433
-Ref: Basic High Level-Footnote-11318734
-Node: Basic Data Typing1318919
-Node: Glossary1322247
-Node: Copying1354134
-Node: GNU Free Documentation License1391677
-Node: Index1416797
+Node: Numeric Functions545452
+Ref: Numeric Functions-Footnote-1549479
+Ref: Numeric Functions-Footnote-2550127
+Ref: Numeric Functions-Footnote-3550175
+Node: String Functions550447
+Ref: String Functions-Footnote-1574588
+Ref: String Functions-Footnote-2574716
+Ref: String Functions-Footnote-3574964
+Node: Gory Details575051
+Ref: table-sub-escapes576842
+Ref: table-sub-proposed578361
+Ref: table-posix-sub579724
+Ref: table-gensub-escapes581265
+Ref: Gory Details-Footnote-1582088
+Node: I/O Functions582242
+Ref: table-system-return-values588696
+Ref: I/O Functions-Footnote-1590776
+Ref: I/O Functions-Footnote-2590924
+Node: Time Functions591044
+Ref: Time Functions-Footnote-1601715
+Ref: Time Functions-Footnote-2601783
+Ref: Time Functions-Footnote-3601941
+Ref: Time Functions-Footnote-4602052
+Ref: Time Functions-Footnote-5602164
+Ref: Time Functions-Footnote-6602391
+Node: Bitwise Functions602657
+Ref: table-bitwise-ops603251
+Ref: Bitwise Functions-Footnote-1609314
+Ref: Bitwise Functions-Footnote-2609487
+Node: Type Functions609678
+Node: I18N Functions612632
+Node: User-defined614283
+Node: Definition Syntax615095
+Ref: Definition Syntax-Footnote-1620789
+Node: Function Example620860
+Ref: Function Example-Footnote-1623782
+Node: Function Calling623804
+Node: Calling A Function624392
+Node: Variable Scope625350
+Node: Pass By Value/Reference628344
+Node: Function Caveats630988
+Ref: Function Caveats-Footnote-1633035
+Node: Return Statement633155
+Node: Dynamic Typing636134
+Node: Indirect Calls637064
+Ref: Indirect Calls-Footnote-1647319
+Node: Functions Summary647447
+Node: Library Functions650152
+Ref: Library Functions-Footnote-1653759
+Ref: Library Functions-Footnote-2653902
+Node: Library Names654073
+Ref: Library Names-Footnote-1657740
+Ref: Library Names-Footnote-2657963
+Node: General Functions658049
+Node: Strtonum Function659152
+Node: Assert Function662174
+Node: Round Function665500
+Node: Cliff Random Function667040
+Node: Ordinal Functions668056
+Ref: Ordinal Functions-Footnote-1671119
+Ref: Ordinal Functions-Footnote-2671371
+Node: Join Function671581
+Ref: Join Function-Footnote-1673351
+Node: Getlocaltime Function673551
+Node: Readfile Function677293
+Node: Shell Quoting679270
+Node: Data File Management680671
+Node: Filetrans Function681303
+Node: Rewind Function685399
+Node: File Checking687308
+Ref: File Checking-Footnote-1688642
+Node: Empty Files688843
+Node: Ignoring Assigns690822
+Node: Getopt Function692372
+Ref: Getopt Function-Footnote-1707583
+Node: Passwd Functions707783
+Ref: Passwd Functions-Footnote-1716622
+Node: Group Functions716710
+Ref: Group Functions-Footnote-1724608
+Node: Walking Arrays724815
+Node: Library Functions Summary727823
+Node: Library Exercises729229
+Node: Sample Programs729694
+Node: Running Examples730464
+Node: Clones731192
+Node: Cut Program732416
+Node: Egrep Program742556
+Node: Id Program751557
+Node: Split Program761504
+Ref: Split Program-Footnote-1771394
+Node: Tee Program771567
+Node: Uniq Program774357
+Node: Wc Program781945
+Node: Bytes vs. Characters782332
+Node: Using extensions783880
+Node: wc program784634
+Node: Miscellaneous Programs789499
+Node: Dupword Program790712
+Node: Alarm Program792742
+Node: Translate Program797597
+Ref: Translate Program-Footnote-1802162
+Node: Labels Program802432
+Ref: Labels Program-Footnote-1805783
+Node: Word Sorting805867
+Node: History Sorting809939
+Node: Extract Program812164
+Node: Simple Sed820218
+Node: Igawk Program823292
+Ref: Igawk Program-Footnote-1837623
+Ref: Igawk Program-Footnote-2837825
+Ref: Igawk Program-Footnote-3837947
+Node: Anagram Program838062
+Node: Signature Program841124
+Node: Programs Summary842371
+Node: Programs Exercises843585
+Ref: Programs Exercises-Footnote-1847715
+Node: Advanced Features847801
+Node: Nondecimal Data849932
+Node: Boolean Typed Values851530
+Node: Array Sorting853409
+Node: Controlling Array Traversal854114
+Ref: Controlling Array Traversal-Footnote-1862482
+Node: Array Sorting Functions862600
+Ref: Array Sorting Functions-Footnote-1867691
+Node: Two-way I/O867887
+Ref: Two-way I/O-Footnote-1875608
+Ref: Two-way I/O-Footnote-2875795
+Node: TCP/IP Networking875877
+Node: Profiling878995
+Node: Extension Philosophy888304
+Node: Advanced Features Summary889783
+Node: Internationalization891798
+Node: I18N and L10N893278
+Node: Explaining gettext893965
+Ref: Explaining gettext-Footnote-1899857
+Ref: Explaining gettext-Footnote-2900042
+Node: Programmer i18n900207
+Ref: Programmer i18n-Footnote-1905156
+Node: Translator i18n905205
+Node: String Extraction905999
+Ref: String Extraction-Footnote-1907131
+Node: Printf Ordering907217
+Ref: Printf Ordering-Footnote-1910003
+Node: I18N Portability910067
+Ref: I18N Portability-Footnote-1912523
+Node: I18N Example912586
+Ref: I18N Example-Footnote-1915861
+Ref: I18N Example-Footnote-2915934
+Node: Gawk I18N916043
+Node: I18N Summary916692
+Node: Debugger918033
+Node: Debugging919033
+Node: Debugging Concepts919474
+Node: Debugging Terms921283
+Node: Awk Debugging923858
+Ref: Awk Debugging-Footnote-1924803
+Node: Sample Debugging Session924935
+Node: Debugger Invocation925469
+Node: Finding The Bug926855
+Node: List of Debugger Commands933329
+Node: Breakpoint Control934662
+Node: Debugger Execution Control938356
+Node: Viewing And Changing Data941718
+Node: Execution Stack945259
+Node: Debugger Info946896
+Node: Miscellaneous Debugger Commands950967
+Node: Readline Support956029
+Node: Limitations956925
+Node: Debugging Summary959479
+Node: Namespaces960758
+Node: Global Namespace961869
+Node: Qualified Names963267
+Node: Default Namespace964266
+Node: Changing The Namespace965007
+Node: Naming Rules966621
+Node: Internal Name Management968469
+Node: Namespace Example969511
+Node: Namespace And Features972073
+Node: Namespace Summary973508
+Node: Arbitrary Precision Arithmetic974985
+Node: Computer Arithmetic976472
+Ref: table-numeric-ranges980238
+Ref: table-floating-point-ranges980731
+Ref: Computer Arithmetic-Footnote-1981389
+Node: Math Definitions981446
+Ref: table-ieee-formats984422
+Node: MPFR features984989
+Node: FP Math Caution986707
+Ref: FP Math Caution-Footnote-1987779
+Node: Inexactness of computations988148
+Node: Inexact representation989179
+Node: Comparing FP Values990539
+Node: Errors accumulate991780
+Node: Strange values993236
+Ref: Strange values-Footnote-1995824
+Node: Getting Accuracy995929
+Node: Try To Round998639
+Node: Setting precision999538
+Ref: table-predefined-precision-strings1000235
+Node: Setting the rounding mode1002065
+Ref: table-gawk-rounding-modes1002439
+Ref: Setting the rounding mode-Footnote-11006370
+Node: Arbitrary Precision Integers1006549
+Ref: Arbitrary Precision Integers-Footnote-11009724
+Node: Checking for MPFR1009873
+Node: POSIX Floating Point Problems1011347
+Ref: POSIX Floating Point Problems-Footnote-11015632
+Node: Floating point summary1015670
+Node: Dynamic Extensions1017860
+Node: Extension Intro1019413
+Node: Plugin License1020679
+Node: Extension Mechanism Outline1021476
+Ref: figure-load-extension1021915
+Ref: figure-register-new-function1023480
+Ref: figure-call-new-function1024572
+Node: Extension API Description1026634
+Node: Extension API Functions Introduction1028347
+Ref: table-api-std-headers1030183
+Node: General Data Types1034432
+Ref: General Data Types-Footnote-11043138
+Node: Memory Allocation Functions1043437
+Ref: Memory Allocation Functions-Footnote-11047938
+Node: Constructor Functions1048037
+Node: API Ownership of MPFR and GMP Values1051690
+Node: Registration Functions1053003
+Node: Extension Functions1053703
+Node: Exit Callback Functions1059025
+Node: Extension Version String1060275
+Node: Input Parsers1060938
+Node: Output Wrappers1073659
+Node: Two-way processors1078171
+Node: Printing Messages1080436
+Ref: Printing Messages-Footnote-11081607
+Node: Updating ERRNO1081760
+Node: Requesting Values1082499
+Ref: table-value-types-returned1083236
+Node: Accessing Parameters1084344
+Node: Symbol Table Access1085581
+Node: Symbol table by name1086093
+Ref: Symbol table by name-Footnote-11089117
+Node: Symbol table by cookie1089245
+Ref: Symbol table by cookie-Footnote-11093430
+Node: Cached values1093494
+Ref: Cached values-Footnote-11097030
+Node: Array Manipulation1097183
+Ref: Array Manipulation-Footnote-11098274
+Node: Array Data Types1098311
+Ref: Array Data Types-Footnote-11100969
+Node: Array Functions1101061
+Node: Flattening Arrays1105559
+Node: Creating Arrays1112535
+Node: Redirection API1117302
+Node: Extension API Variables1120135
+Node: Extension Versioning1120846
+Ref: gawk-api-version1121275
+Node: Extension GMP/MPFR Versioning1123006
+Node: Extension API Informational Variables1124634
+Node: Extension API Boilerplate1125707
+Node: Changes from API V11129681
+Node: Finding Extensions1131253
+Node: Extension Example1131812
+Node: Internal File Description1132610
+Node: Internal File Ops1136690
+Ref: Internal File Ops-Footnote-11148040
+Node: Using Internal File Ops1148180
+Ref: Using Internal File Ops-Footnote-11150563
+Node: Extension Samples1150837
+Node: Extension Sample File Functions1152366
+Node: Extension Sample Fnmatch1160015
+Node: Extension Sample Fork1161502
+Node: Extension Sample Inplace1162720
+Node: Extension Sample Ord1166346
+Node: Extension Sample Readdir1167182
+Ref: table-readdir-file-types1168071
+Node: Extension Sample Revout1169138
+Node: Extension Sample Rev2way1169727
+Node: Extension Sample Read write array1170467
+Node: Extension Sample Readfile1172409
+Node: Extension Sample Time1173504
+Node: Extension Sample API Tests1175256
+Node: gawkextlib1175748
+Node: Extension summary1178666
+Node: Extension Exercises1182368
+Node: Language History1183610
+Node: V7/SVR3.11185266
+Node: SVR41187418
+Node: POSIX1188852
+Node: BTL1190233
+Node: POSIX/GNU1190962
+Node: Feature History1196740
+Node: Common Extensions1213059
+Node: Ranges and Locales1214342
+Ref: Ranges and Locales-Footnote-11218958
+Ref: Ranges and Locales-Footnote-21218985
+Ref: Ranges and Locales-Footnote-31219220
+Node: Contributors1219443
+Node: History summary1225440
+Node: Installation1226820
+Node: Gawk Distribution1227764
+Node: Getting1228248
+Node: Extracting1229211
+Node: Distribution contents1230849
+Node: Unix Installation1237329
+Node: Quick Installation1238011
+Node: Shell Startup Files1240425
+Node: Additional Configuration Options1241514
+Node: Configuration Philosophy1243829
+Node: Non-Unix Installation1246198
+Node: PC Installation1246658
+Node: PC Binary Installation1247496
+Node: PC Compiling1247931
+Node: PC Using1249048
+Node: Cygwin1252601
+Node: MSYS1253825
+Node: VMS Installation1254427
+Node: VMS Compilation1255218
+Ref: VMS Compilation-Footnote-11256447
+Node: VMS Dynamic Extensions1256505
+Node: VMS Installation Details1258190
+Node: VMS Running1260443
+Node: VMS GNV1264722
+Node: VMS Old Gawk1265457
+Node: Bugs1265928
+Node: Bug address1266591
+Node: Usenet1269573
+Node: Maintainers1270577
+Node: Other Versions1271762
+Node: Installation summary1279627
+Node: Notes1280836
+Node: Compatibility Mode1281630
+Node: Additions1282412
+Node: Accessing The Source1283337
+Node: Adding Code1284774
+Node: New Ports1290993
+Node: Derived Files1295368
+Ref: Derived Files-Footnote-11301028
+Ref: Derived Files-Footnote-21301063
+Ref: Derived Files-Footnote-31301661
+Node: Future Extensions1301775
+Node: Implementation Limitations1302433
+Node: Extension Design1303643
+Node: Old Extension Problems1304787
+Ref: Old Extension Problems-Footnote-11306305
+Node: Extension New Mechanism Goals1306362
+Ref: Extension New Mechanism Goals-Footnote-11309726
+Node: Extension Other Design Decisions1309915
+Node: Extension Future Growth1312028
+Node: Notes summary1312634
+Node: Basic Concepts1313792
+Node: Basic High Level1314473
+Ref: figure-general-flow1314755
+Ref: figure-process-flow1315440
+Ref: Basic High Level-Footnote-11318741
+Node: Basic Data Typing1318926
+Node: Glossary1322254
+Node: Copying1354141
+Node: GNU Free Documentation License1391684
+Node: Index1416804
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 06c3d90..8992166 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18390,8 +18390,8 @@ available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
-@item @code{bool(@var{expression})}
-@cindexgawkfunc{bool}
+@item @code{bmkool(@var{expression})}
+@cindexgawkfunc{mkbool}
Return a Boolean-typed value based on the regular Boolean value
of @var{expression}. Boolean ``true'' values have numeric value one.
Boolean ``false'' values have numeric
@@ -29499,11 +29499,10 @@ It's easy to import Boolean data into @command{awk},
but then the fact
that it was originally Boolean is lost. Exporting data is even harder;
there's no way to indicate that a value is really Boolean.
-To solve this problem, @command{gawk} provides a function named @code{bool()}.
+To solve this problem, @command{gawk} provides a function named
@code{mkbool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-@c HERE
The returned values are normal @command{awk} numeric values, with
values of either one or zero,
depending upon the truth
@@ -29520,7 +29519,7 @@ While it would have been possible to add two new
built-in variables
of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
undoubtedly have broken many existing @command{awk} programs. Instead,
having a ``generator'' function that creates Boolean values gives
-flexibility, without breaking any existing code.
+flexibility, without breaking as much existing code.
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 57a87eb..75607b2 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17531,8 +17531,8 @@ available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
-@item @code{bool(@var{expression})}
-@cindexgawkfunc{bool}
+@item @code{bmkool(@var{expression})}
+@cindexgawkfunc{mkbool}
Return a Boolean-typed value based on the regular Boolean value
of @var{expression}. Boolean ``true'' values have numeric value one.
Boolean ``false'' values have numeric
@@ -28381,11 +28381,10 @@ It's easy to import Boolean data into @command{awk},
but then the fact
that it was originally Boolean is lost. Exporting data is even harder;
there's no way to indicate that a value is really Boolean.
-To solve this problem, @command{gawk} provides a function named @code{bool()}.
+To solve this problem, @command{gawk} provides a function named
@code{mkbool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-@c HERE
The returned values are normal @command{awk} numeric values, with
values of either one or zero,
depending upon the truth
@@ -28402,7 +28401,7 @@ While it would have been possible to add two new
built-in variables
of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
undoubtedly have broken many existing @command{awk} programs. Instead,
having a ``generator'' function that creates Boolean values gives
-flexibility, without breaking any existing code.
+flexibility, without breaking as much existing code.
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
diff --git a/test/ChangeLog b/test/ChangeLog
index 6ae679e..7198c0f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * asortbool.awk, functab5.ok, id.ok, rwarrray.awk,
+ symtab11.ok: Revise after code changes.
+
2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
* asortbool.ok: Revise after code changes.
diff --git a/test/asortbool.awk b/test/asortbool.awk
index 7f5a94f..3ee02cb 100644
--- a/test/asortbool.awk
+++ b/test/asortbool.awk
@@ -3,8 +3,8 @@ BEGIN {
a[2] = -45
a[3] = 45
a[4][1] = 47
- a[5] = bool(1)
- a[6] = bool(0)
+ a[5] = mkbool(1)
+ a[6] = mkbool(0)
asort(a, b, "@val_type_asc")
diff --git a/test/functab5.ok b/test/functab5.ok
index ef11098..d27f139 100644
--- a/test/functab5.ok
+++ b/test/functab5.ok
@@ -3,7 +3,6 @@ asort'
asorti'
atan2'
bindtextdomain'
-bool'
chdir'
close'
compl'
@@ -22,6 +21,7 @@ length'
log'
lshift'
match'
+mkbool'
mktime'
or'
patsplit'
diff --git a/test/id.ok b/test/id.ok
index f990546..941d5ad 100644
--- a/test/id.ok
+++ b/test/id.ok
@@ -34,7 +34,6 @@ asort -> builtin
asorti -> builtin
atan2 -> builtin
bindtextdomain -> builtin
-bool -> builtin
close -> builtin
compl -> builtin
cos -> builtin
@@ -53,6 +52,7 @@ length -> builtin
log -> builtin
lshift -> builtin
match -> builtin
+mkbool -> builtin
mktime -> builtin
or -> builtin
patsplit -> builtin
diff --git a/test/rwarray.awk b/test/rwarray.awk
index b868fa4..eae2230 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -12,7 +12,7 @@ BEGIN {
dict[strnum_sub] = f[1]
bool_sub = "bool-sub"
- dict[bool_sub] = bool(1)
+ dict[bool_sub] = mkbool(1)
n = asorti(dict, dictindices)
for (i = 1; i <= n; i++)
diff --git a/test/symtab11.ok b/test/symtab11.ok
index da2cfcb..c46d3ae 100644
--- a/test/symtab11.ok
+++ b/test/symtab11.ok
@@ -37,7 +37,6 @@ BEGIN -- Functab is next
[asorti] = asorti
[atan2] = atan2
[bindtextdomain] = bindtextdomain
-[bool] = bool
[close] = close
[compl] = compl
[cos] = cos
@@ -54,6 +53,7 @@ BEGIN -- Functab is next
[log] = log
[lshift] = lshift
[match] = match
+[mkbool] = mkbool
[mktime] = mktime
[or] = or
[patsplit] = patsplit
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=200c22e0556cdaf381d758304e69807d1b0ceff7
commit 200c22e0556cdaf381d758304e69807d1b0ceff7
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri Apr 30 11:51:43 2021 +0300
Fixes to awk.h.
diff --git a/ChangeLog b/ChangeLog
index 9548651..5e2e98e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-04-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (boolval): Remove check for BOOL flag. It was incorrect.
+ Thanks to Andrew Schorr for the catch.
+ For Node_val, update the comment to describe the BOOL flag, and
+ move BOOL up to be alongside the flags for Node_val.
+
2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
Make bools plain numbers that have bool flag instead of
diff --git a/awk.h b/awk.h
index c0f44d5..57dae1e 100644
--- a/awk.h
+++ b/awk.h
@@ -436,6 +436,10 @@ typedef struct exp_node {
* is a hint to indicate that an integer array optimization may
be
* used when this value appears as a subscript.
*
+ * The BOOL flag indicates that this number should be converted
to True
+ * or False by extensions that interchange data with other
languages,
+ * via JSON, XML or some other serialization mechanism.
+ *
* We hope that the rest of the flags are self-explanatory. :-)
*/
MALLOC = 0x0001, /* stptr can be free'd, i.e. not a
field node pointing into a shared buffer */
@@ -445,25 +449,25 @@ typedef struct exp_node {
NUMBER = 0x0010, /* assigned as number */
USER_INPUT = 0x0020, /* user input: if NUMERIC then
* a NUMBER */
- INTLSTR = 0x0040, /* use localized version */
- NUMINT = 0x0080, /* numeric value is an integer */
- INTIND = 0x0100, /* integral value is array index;
+ BOOL = 0x0040, /* this is a boolean value */
+ INTLSTR = 0x0080, /* use localized version */
+ NUMINT = 0x0100, /* numeric value is an integer */
+ INTIND = 0x0200, /* integral value is array index;
* lazy conversion to string.
*/
- WSTRCUR = 0x0200, /* wide str value is current */
- MPFN = 0x0400, /* arbitrary-precision floating-point
number */
- MPZN = 0x0800, /* arbitrary-precision integer */
- NO_EXT_SET = 0x1000, /* extension cannot set a value for
this variable */
- NULL_FIELD = 0x2000, /* this is the null field */
+ WSTRCUR = 0x0400, /* wide str value is current */
+ MPFN = 0x0800, /* arbitrary-precision floating-point
number */
+ MPZN = 0x01000, /* arbitrary-precision integer */
+ NO_EXT_SET = 0x02000, /* extension cannot set a value for
this variable */
+ NULL_FIELD = 0x04000, /* this is the null field */
/* type = Node_var_array */
- ARRAYMAXED = 0x4000, /* array is at max size */
- HALFHAT = 0x8000, /* half-capacity Hashed Array
Tree;
+ ARRAYMAXED = 0x08000, /* array is at max size */
+ HALFHAT = 0x010000, /* half-capacity Hashed Array
Tree;
* See cint_array.c */
- XARRAY = 0x10000,
- NUMCONSTSTR = 0x20000, /* have string value for
numeric constant */
- REGEX = 0x40000, /* this is a typed regex */
- BOOL = 0x80000, /* this is a boolean value */
+ XARRAY = 0x020000,
+ NUMCONSTSTR = 0x040000, /* have string value for
numeric constant */
+ REGEX = 0x080000, /* this is a typed regex */
} flags;
long valref;
} NODE;
@@ -1998,7 +2002,7 @@ static inline bool
boolval(NODE *t)
{
(void) fixtype(t);
- if ((t->flags & (BOOL|NUMBER)) != 0)
+ if ((t->flags & NUMBER) != 0)
return ! is_zero(t);
return (t->stlen > 0);
}
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=fbda8cdd8e8c5a324f1174b070aa0bdcffc5115d
commit fbda8cdd8e8c5a324f1174b070aa0bdcffc5115d
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Apr 29 19:48:32 2021 +0300
Remove bool.notes.
diff --git a/bool.notes b/bool.notes
deleted file mode 100644
index 8e24c2b..0000000
--- a/bool.notes
+++ /dev/null
@@ -1,53 +0,0 @@
-Thu Mar 18 21:05:29 IST 2021
-============================
-
-Design Notes for a Boolean Type in Gawk
-
-1. A new function bool(val) converts val to bool, returning Boolean TRUE
-or FALSE. This is the generator for boolean values and is enough to have
-instead of predefining new variables TRUE and FALSE.
-
-2. Assigning from a boolean value copies the bool type.
-
-3. Boolean variables have numeric values 1 and 0 respectively, and string
-values "TRUE" and "FALSE". Thus they differ from other variables where a
-"false" value must be zero and null.
-
-Given:
-
- true = bool(1)
- false = bool(0)
-
-this implies all of the following:
-
- print(true) --> "TRUE"
- print(false) --> "FALSE"
- Same for %s in printf
- Same for bool_var ""
- printf %d gives 0/1
-
-4. typeof() returns "bool".
-
-5. Numeric operators treat booleans as numbers. asort() sorts booleans before
-numbers, and false before true.
-
-6. These string function generate a runtime fatal error
-if given an argument / target of boolean type:
-
- gsub sub
-
-These functions merely treat the value as a string
-but issue a lint warning.
-
- substr match index gensub
- length split patsplit
- tolower toupper
-
-7. Updates to API needed for an additional type, and the table
-for requested vs. returns.
-
-8. The following extensions need revising:
-
- - JSON extension
- - dump / read array extensions
- - what else?
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=84b8134d494058582bd65fc02b7630ece90ace63
commit 84b8134d494058582bd65fc02b7630ece90ace63
Merge: d73e542 3a530fc
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Apr 28 22:04:08 2021 +0300
Merge branch 'feature/bool' of ssh://git.sv.gnu.org/srv/git/gawk into
feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=d73e542791ccb18380cd836b8ea4a4a4b3535538
commit d73e542791ccb18380cd836b8ea4a4a4b3535538
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Apr 28 22:03:40 2021 +0300
Make booleans just special numbers.
diff --git a/ChangeLog b/ChangeLog
index 65cc51a..9548651 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make bools plain numbers that have bool flag instead of
+ being weird string values.
+
+ * array.c (do_sort_up_value_type): Remove special ordering
+ for booleans.
+ * awk.h (warn_bool): Remove declaration.
+ * builtin.c (warn_bool): Remove function and all calls.
+ * gawkapi.c (node_to_awk_value): Update switches to look for
+ NUMBER|BOOL.
+ * node.c (make_bool_node): Revise string values and flag bits.
+
2021-04-16 Arnold D. Robbins <arnold@skeeve.com>
* main (arg_assign): For -v '@/...' make sure that there are
diff --git a/array.c b/array.c
index c6bfa44..58ca2c5 100644
--- a/array.c
+++ b/array.c
@@ -1209,24 +1209,12 @@ do_sort_up_value_type(const void *p1, const void *p2)
(void) fixtype(n1);
(void) fixtype(n2);
- /* 3a. Bools first */
- if ((n1->flags & BOOL) != 0 && (n2->flags & BOOL) != 0) {
- return cmp_numbers(n1, n2);
- }
-
- /* 3b. Bools before everything else */
- if ((n1->flags & BOOL) != 0 && (n2->flags & BOOL) == 0) {
- return -1;
- } else if ((n1->flags & BOOL) == 0 && (n2->flags & BOOL) != 0) {
- return 1;
- }
-
- /* 3c. Numbers next */
+ /* 3a. Numbers first */
if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) {
return cmp_numbers(n1, n2);
}
- /* 3d. All numbers are less than all strings. This is aribitrary. */
+ /* 3b. All numbers are less than all strings. This is aribitrary. */
if ((n1->flags & NUMBER) != 0 && (n2->flags & STRING) != 0) {
return -1;
} else if ((n1->flags & STRING) != 0 && (n2->flags & NUMBER) != 0) {
diff --git a/awk.h b/awk.h
index f4fa4d4..c0f44d5 100644
--- a/awk.h
+++ b/awk.h
@@ -1455,7 +1455,6 @@ extern bool is_identchar(int c);
extern NODE *make_regnode(NODETYPE type, NODE *exp);
extern bool validate_qualified_name(char *token);
/* builtin.c */
-extern void warn_bool(const char *func, int argnum, NODE *n);
extern double double_to_int(double d);
extern NODE *do_exp(int nargs);
extern NODE *do_fflush(int nargs);
diff --git a/builtin.c b/builtin.c
index 1158fad..d56d783 100644
--- a/builtin.c
+++ b/builtin.c
@@ -381,8 +381,6 @@ do_index(int nargs)
s1 = force_string(s1);
s2 = force_string(s2);
- warn_bool("index", 1, s1);
- warn_bool("index", 2, s2);
p1 = s1->stptr;
p2 = s2->stptr;
@@ -554,7 +552,6 @@ do_length(int nargs)
if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "length");
tmp = force_string(tmp);
- warn_bool("length", 1, tmp);
if (gawk_mb_cur_max > 1) {
tmp = force_wstring(tmp);
@@ -1782,16 +1779,6 @@ do_sqrt(int nargs)
return make_number((AWKNUM) sqrt(arg));
}
-/* warn_bool --- warn that bool parameter is used as a string */
-
-void
-warn_bool(const char *func, int argnum, NODE *n)
-{
- if (do_lint && (n->flags & BOOL) != 0)
- lintwarn(_("%s: argument %d of type bool used as a string"),
- func, argnum);
-}
-
/* do_substr --- do the substr function */
NODE *
@@ -1815,7 +1802,6 @@ do_substr(int nargs)
DEREF(t1);
t1 = POP_STRING();
- warn_bool("substr", 1, t1);
if (nargs == 3) {
if (! (d_length >= 1)) {
@@ -2421,7 +2407,6 @@ do_tolower(int nargs)
NODE *t1, *t2;
t1 = POP_SCALAR();
- warn_bool("tolower", 1, t1);
if (do_lint && (fixtype(t1)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "tolower");
t1 = force_string(t1);
@@ -2453,7 +2438,6 @@ do_toupper(int nargs)
NODE *t1, *t2;
t1 = POP_SCALAR();
- warn_bool("toupper", 1, t1);
if (do_lint && (fixtype(t1)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "toupper");
t1 = force_string(t1);
@@ -2678,7 +2662,6 @@ do_match(int nargs)
tre = POP();
rp = re_update(tre);
t1 = POP_STRING();
- warn_bool("mastch", 1, t1);
rstart = research(rp, t1->stptr, 0, t1->stlen, RE_NEED_START);
if (rstart >= 0) { /* match succeded */
@@ -2899,7 +2882,6 @@ do_sub(int nargs, unsigned int flags)
rp = re_update(tmp);
target = POP_STRING(); /* original string */
- warn_bool("gensub", 3, target);
glob_flag = POP_SCALAR(); /* value of global flag */
if ( (glob_flag->flags & STRING) != 0
@@ -4135,8 +4117,8 @@ do_typeof(int nargs)
break;
case Node_val:
switch (fixtype(arg)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case BOOL:
- res = "bool";
+ case NUMBER|BOOL:
+ res = "number|bool";
break;
case NUMBER:
res = "number";
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 6e7ad16..011a0bc 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Revise doc for bools; they're now just numbers
+ with an extra flag.
+ * gawk.1: Ditto.
+ * awkcard.in: Ditto.
+
2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Controlling Scanning): Document bools for
diff --git a/doc/awkcard.in b/doc/awkcard.in
index cf2cf76..0229e18 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1924,9 +1924,8 @@ See the manual for details.\*(CB
\*(CD\*(FCbool(\*(FIexpression\*(FC)\*(FR
.br
Return a Boolean-typed value based on the Boolean value
-of \*(FIexpression\fP. True values have a numeric value of one
-and a string value of \*(FC"TRUE"\fP. False values have a numeric value of zero
-and a string value of \*(FC"FALSE"\fP.\*(CB
+of \*(FIexpression\fP. True values have a numeric value of one.
+False values have a numeric value of zero.\*(CB
.in -.2i
.EB "\s+2\f(HBGENERATOR FUNCTIONS (\*(GK\f(HB)\*(FR\s0"
.sp .5
diff --git a/doc/gawk.1 b/doc/gawk.1
index 86ddd7c..e71ceba 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 6 2021" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 28 2021" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -3488,8 +3488,8 @@ they work and why they exist.
Based on the boolean value of
.I expression
return either a true value or a false value.
-True values have numeric value one and string value \fB"TRUE"\fR.
-False values have numeric value zero and string value \fB"False"\fR.
+True values have numeric value one.
+False values have numeric value zero.
.SH USER-DEFINED FUNCTIONS
Functions in \*(AK are defined as follows:
.PP
diff --git a/doc/gawk.info b/doc/gawk.info
index 853014f..b73b18e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12151,11 +12151,9 @@ available:
'"@val_type_asc"'
Order by element values in ascending order (rather than by
indices). Ordering is by the type assigned to the element (*note
- Typing and Comparison::). All Boolean values come before all
- numeric values (*note Boolean Typed Values::), and all numeric
- values come before all string values, which in turn come before all
- subarrays. (Subarrays have not been described yet; *note Arrays of
- Arrays::.)
+ Typing and Comparison::). All numeric values come before all
+ string values, which in turn come before all subarrays. (Subarrays
+ have not been described yet; *note Arrays of Arrays::.)
If you choose to use this feature in traversing 'FUNCTAB' (*note
Auto-set::), then the order is built-in functions first (*note
@@ -12854,10 +12852,9 @@ compatibility mode (*note Options::):
'bool(EXPRESSION)'
Return a Boolean-typed value based on the regular Boolean value of
- EXPRESSION. Boolean "true" values have numeric value one and
- string value '"TRUE"'. Boolean "false" values have numeric zero
- and string value '"FALSE"'. This is discussed in more detail in
- *note Boolean Typed Values::.
+ EXPRESSION. Boolean "true" values have numeric value one. Boolean
+ "false" values have numeric zero. This is discussed in more detail
+ in *note Boolean Typed Values::.
File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev:
Boolean Functions, Up: Built-in
@@ -14433,9 +14430,6 @@ contexts.
'"array"'
X is an array.
- '"bool"'
- X is a Boolean typed value (*note Boolean Typed Values::).
-
'"regexp"'
X is a strongly typed regexp (*note Strong Regexp
Constants::).
@@ -14443,6 +14437,9 @@ contexts.
'"number"'
X is a number.
+ '"number|bool"'
+ X is a Boolean typed value (*note Boolean Typed Values::).
+
'"string"'
X is a string.
@@ -20898,7 +20895,7 @@ their own:
* Menu:
* Nondecimal Data:: Allowing nondecimal input data.
-* Boolean Typed Values:: Values with 'bool' type.
+* Boolean Typed Values:: Values with 'number|bool' type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -20977,16 +20974,16 @@ there's no way to indicate that a value is really
Boolean.
takes one argument, which is any 'awk' expression, and it returns a
value of Boolean type.
- The returned values are different than normal 'awk' values. When
-treated as numbers, they are either one or zero, depending upon the
-truth value of the original expression passed in the call to 'bool()'.
-When treated as strings, they are either '"TRUE"' or '"FALSE"', again
-depending upon the truth value of the expression passed in the call to
-'bool()'. The value for "false" is thus unusual; it is zero
-numerically, but not empty when treated as a string.
+ The returned values are normal 'awk' numeric values, with values of
+either one or zero, depending upon the truth value of the original
+expression passed in the call to 'bool()'.
+
+ The 'typeof()' function (*note Type Functions::) returns
+'"number|bool"' for these values.
- The 'typeof()' function (*note Type Functions::) returns '"bool"' for
-these values.
+ Thus Boolean-typed values _are_ numbers as far as 'gawk' is
+concerned, except that extension code can treat them as Booleans if
+desired.
While it would have been possible to add two new built-in variables
of Boolean type named 'TRUE' and 'FALSE', doing so would undoubtedly
@@ -33231,8 +33228,8 @@ Localization
Logical Expression
An expression using the operators for logic, AND, OR, and NOT,
- written '&&', '||', and '!' in 'awk'. Often called Boolean
- expressions, after the mathematician who pioneered this kind of
+ written '&&', '||', and '!' in 'awk'. Often called "Boolean
+ expressions", after the mathematician who pioneered this kind of
mathematical logic.
Lvalue
@@ -38426,377 +38423,377 @@ Node: Assigning Elements510508
Node: Array Example510999
Node: Scanning an Array512758
Node: Controlling Scanning515780
-Ref: Controlling Scanning-Footnote-1522332
-Node: Numeric Array Subscripts522648
-Node: Uninitialized Subscripts524832
-Node: Delete526451
-Ref: Delete-Footnote-1529203
-Node: Multidimensional529260
-Node: Multiscanning532355
-Node: Arrays of Arrays533946
-Node: Arrays Summary538714
-Node: Functions540807
-Node: Built-in541845
-Node: Calling Built-in542998
-Node: Boolean Functions544994
-Node: Numeric Functions545604
-Ref: Numeric Functions-Footnote-1549631
-Ref: Numeric Functions-Footnote-2550279
-Ref: Numeric Functions-Footnote-3550327
-Node: String Functions550599
-Ref: String Functions-Footnote-1574740
-Ref: String Functions-Footnote-2574868
-Ref: String Functions-Footnote-3575116
-Node: Gory Details575203
-Ref: table-sub-escapes576994
-Ref: table-sub-proposed578513
-Ref: table-posix-sub579876
-Ref: table-gensub-escapes581417
-Ref: Gory Details-Footnote-1582240
-Node: I/O Functions582394
-Ref: table-system-return-values588848
-Ref: I/O Functions-Footnote-1590928
-Ref: I/O Functions-Footnote-2591076
-Node: Time Functions591196
-Ref: Time Functions-Footnote-1601867
-Ref: Time Functions-Footnote-2601935
-Ref: Time Functions-Footnote-3602093
-Ref: Time Functions-Footnote-4602204
-Ref: Time Functions-Footnote-5602316
-Ref: Time Functions-Footnote-6602543
-Node: Bitwise Functions602809
-Ref: table-bitwise-ops603403
-Ref: Bitwise Functions-Footnote-1609466
-Ref: Bitwise Functions-Footnote-2609639
-Node: Type Functions609830
-Node: I18N Functions612777
-Node: User-defined614428
-Node: Definition Syntax615240
-Ref: Definition Syntax-Footnote-1620934
-Node: Function Example621005
-Ref: Function Example-Footnote-1623927
-Node: Function Calling623949
-Node: Calling A Function624537
-Node: Variable Scope625495
-Node: Pass By Value/Reference628489
-Node: Function Caveats631133
-Ref: Function Caveats-Footnote-1633180
-Node: Return Statement633300
-Node: Dynamic Typing636279
-Node: Indirect Calls637209
-Ref: Indirect Calls-Footnote-1647464
-Node: Functions Summary647592
-Node: Library Functions650297
-Ref: Library Functions-Footnote-1653904
-Ref: Library Functions-Footnote-2654047
-Node: Library Names654218
-Ref: Library Names-Footnote-1657885
-Ref: Library Names-Footnote-2658108
-Node: General Functions658194
-Node: Strtonum Function659297
-Node: Assert Function662319
-Node: Round Function665645
-Node: Cliff Random Function667185
-Node: Ordinal Functions668201
-Ref: Ordinal Functions-Footnote-1671264
-Ref: Ordinal Functions-Footnote-2671516
-Node: Join Function671726
-Ref: Join Function-Footnote-1673496
-Node: Getlocaltime Function673696
-Node: Readfile Function677438
-Node: Shell Quoting679415
-Node: Data File Management680816
-Node: Filetrans Function681448
-Node: Rewind Function685544
-Node: File Checking687453
-Ref: File Checking-Footnote-1688787
-Node: Empty Files688988
-Node: Ignoring Assigns690967
-Node: Getopt Function692517
-Ref: Getopt Function-Footnote-1707728
-Node: Passwd Functions707928
-Ref: Passwd Functions-Footnote-1716767
-Node: Group Functions716855
-Ref: Group Functions-Footnote-1724753
-Node: Walking Arrays724960
-Node: Library Functions Summary727968
-Node: Library Exercises729374
-Node: Sample Programs729839
-Node: Running Examples730609
-Node: Clones731337
-Node: Cut Program732561
-Node: Egrep Program742701
-Node: Id Program751702
-Node: Split Program761649
-Ref: Split Program-Footnote-1771539
-Node: Tee Program771712
-Node: Uniq Program774502
-Node: Wc Program782090
-Node: Bytes vs. Characters782477
-Node: Using extensions784025
-Node: wc program784779
-Node: Miscellaneous Programs789644
-Node: Dupword Program790857
-Node: Alarm Program792887
-Node: Translate Program797742
-Ref: Translate Program-Footnote-1802307
-Node: Labels Program802577
-Ref: Labels Program-Footnote-1805928
-Node: Word Sorting806012
-Node: History Sorting810084
-Node: Extract Program812309
-Node: Simple Sed820363
-Node: Igawk Program823437
-Ref: Igawk Program-Footnote-1837768
-Ref: Igawk Program-Footnote-2837970
-Ref: Igawk Program-Footnote-3838092
-Node: Anagram Program838207
-Node: Signature Program841269
-Node: Programs Summary842516
-Node: Programs Exercises843730
-Ref: Programs Exercises-Footnote-1847860
-Node: Advanced Features847946
-Node: Nondecimal Data850070
-Node: Boolean Typed Values851668
-Node: Array Sorting853676
-Node: Controlling Array Traversal854381
-Ref: Controlling Array Traversal-Footnote-1862749
-Node: Array Sorting Functions862867
-Ref: Array Sorting Functions-Footnote-1867958
-Node: Two-way I/O868154
-Ref: Two-way I/O-Footnote-1875875
-Ref: Two-way I/O-Footnote-2876062
-Node: TCP/IP Networking876144
-Node: Profiling879262
-Node: Extension Philosophy888571
-Node: Advanced Features Summary890050
-Node: Internationalization892065
-Node: I18N and L10N893545
-Node: Explaining gettext894232
-Ref: Explaining gettext-Footnote-1900124
-Ref: Explaining gettext-Footnote-2900309
-Node: Programmer i18n900474
-Ref: Programmer i18n-Footnote-1905423
-Node: Translator i18n905472
-Node: String Extraction906266
-Ref: String Extraction-Footnote-1907398
-Node: Printf Ordering907484
-Ref: Printf Ordering-Footnote-1910270
-Node: I18N Portability910334
-Ref: I18N Portability-Footnote-1912790
-Node: I18N Example912853
-Ref: I18N Example-Footnote-1916128
-Ref: I18N Example-Footnote-2916201
-Node: Gawk I18N916310
-Node: I18N Summary916959
-Node: Debugger918300
-Node: Debugging919300
-Node: Debugging Concepts919741
-Node: Debugging Terms921550
-Node: Awk Debugging924125
-Ref: Awk Debugging-Footnote-1925070
-Node: Sample Debugging Session925202
-Node: Debugger Invocation925736
-Node: Finding The Bug927122
-Node: List of Debugger Commands933596
-Node: Breakpoint Control934929
-Node: Debugger Execution Control938623
-Node: Viewing And Changing Data941985
-Node: Execution Stack945526
-Node: Debugger Info947163
-Node: Miscellaneous Debugger Commands951234
-Node: Readline Support956296
-Node: Limitations957192
-Node: Debugging Summary959746
-Node: Namespaces961025
-Node: Global Namespace962136
-Node: Qualified Names963534
-Node: Default Namespace964533
-Node: Changing The Namespace965274
-Node: Naming Rules966888
-Node: Internal Name Management968736
-Node: Namespace Example969778
-Node: Namespace And Features972340
-Node: Namespace Summary973775
-Node: Arbitrary Precision Arithmetic975252
-Node: Computer Arithmetic976739
-Ref: table-numeric-ranges980505
-Ref: table-floating-point-ranges980998
-Ref: Computer Arithmetic-Footnote-1981656
-Node: Math Definitions981713
-Ref: table-ieee-formats984689
-Node: MPFR features985256
-Node: FP Math Caution986974
-Ref: FP Math Caution-Footnote-1988046
-Node: Inexactness of computations988415
-Node: Inexact representation989446
-Node: Comparing FP Values990806
-Node: Errors accumulate992047
-Node: Strange values993503
-Ref: Strange values-Footnote-1996091
-Node: Getting Accuracy996196
-Node: Try To Round998906
-Node: Setting precision999805
-Ref: table-predefined-precision-strings1000502
-Node: Setting the rounding mode1002332
-Ref: table-gawk-rounding-modes1002706
-Ref: Setting the rounding mode-Footnote-11006637
-Node: Arbitrary Precision Integers1006816
-Ref: Arbitrary Precision Integers-Footnote-11009991
-Node: Checking for MPFR1010140
-Node: POSIX Floating Point Problems1011614
-Ref: POSIX Floating Point Problems-Footnote-11015899
-Node: Floating point summary1015937
-Node: Dynamic Extensions1018127
-Node: Extension Intro1019680
-Node: Plugin License1020946
-Node: Extension Mechanism Outline1021743
-Ref: figure-load-extension1022182
-Ref: figure-register-new-function1023747
-Ref: figure-call-new-function1024839
-Node: Extension API Description1026901
-Node: Extension API Functions Introduction1028614
-Ref: table-api-std-headers1030450
-Node: General Data Types1034699
-Ref: General Data Types-Footnote-11043405
-Node: Memory Allocation Functions1043704
-Ref: Memory Allocation Functions-Footnote-11048205
-Node: Constructor Functions1048304
-Node: API Ownership of MPFR and GMP Values1051957
-Node: Registration Functions1053270
-Node: Extension Functions1053970
-Node: Exit Callback Functions1059292
-Node: Extension Version String1060542
-Node: Input Parsers1061205
-Node: Output Wrappers1073926
-Node: Two-way processors1078438
-Node: Printing Messages1080703
-Ref: Printing Messages-Footnote-11081874
-Node: Updating ERRNO1082027
-Node: Requesting Values1082766
-Ref: table-value-types-returned1083503
-Node: Accessing Parameters1084611
-Node: Symbol Table Access1085848
-Node: Symbol table by name1086360
-Ref: Symbol table by name-Footnote-11089384
-Node: Symbol table by cookie1089512
-Ref: Symbol table by cookie-Footnote-11093697
-Node: Cached values1093761
-Ref: Cached values-Footnote-11097297
-Node: Array Manipulation1097450
-Ref: Array Manipulation-Footnote-11098541
-Node: Array Data Types1098578
-Ref: Array Data Types-Footnote-11101236
-Node: Array Functions1101328
-Node: Flattening Arrays1105826
-Node: Creating Arrays1112802
-Node: Redirection API1117569
-Node: Extension API Variables1120402
-Node: Extension Versioning1121113
-Ref: gawk-api-version1121542
-Node: Extension GMP/MPFR Versioning1123273
-Node: Extension API Informational Variables1124901
-Node: Extension API Boilerplate1125974
-Node: Changes from API V11129948
-Node: Finding Extensions1131520
-Node: Extension Example1132079
-Node: Internal File Description1132877
-Node: Internal File Ops1136957
-Ref: Internal File Ops-Footnote-11148307
-Node: Using Internal File Ops1148447
-Ref: Using Internal File Ops-Footnote-11150830
-Node: Extension Samples1151104
-Node: Extension Sample File Functions1152633
-Node: Extension Sample Fnmatch1160282
-Node: Extension Sample Fork1161769
-Node: Extension Sample Inplace1162987
-Node: Extension Sample Ord1166613
-Node: Extension Sample Readdir1167449
-Ref: table-readdir-file-types1168338
-Node: Extension Sample Revout1169405
-Node: Extension Sample Rev2way1169994
-Node: Extension Sample Read write array1170734
-Node: Extension Sample Readfile1172676
-Node: Extension Sample Time1173771
-Node: Extension Sample API Tests1175523
-Node: gawkextlib1176015
-Node: Extension summary1178933
-Node: Extension Exercises1182635
-Node: Language History1183877
-Node: V7/SVR3.11185533
-Node: SVR41187685
-Node: POSIX1189119
-Node: BTL1190500
-Node: POSIX/GNU1191229
-Node: Feature History1197007
-Node: Common Extensions1213326
-Node: Ranges and Locales1214609
-Ref: Ranges and Locales-Footnote-11219225
-Ref: Ranges and Locales-Footnote-21219252
-Ref: Ranges and Locales-Footnote-31219487
-Node: Contributors1219710
-Node: History summary1225707
-Node: Installation1227087
-Node: Gawk Distribution1228031
-Node: Getting1228515
-Node: Extracting1229478
-Node: Distribution contents1231116
-Node: Unix Installation1237596
-Node: Quick Installation1238278
-Node: Shell Startup Files1240692
-Node: Additional Configuration Options1241781
-Node: Configuration Philosophy1244096
-Node: Non-Unix Installation1246465
-Node: PC Installation1246925
-Node: PC Binary Installation1247763
-Node: PC Compiling1248198
-Node: PC Using1249315
-Node: Cygwin1252868
-Node: MSYS1254092
-Node: VMS Installation1254694
-Node: VMS Compilation1255485
-Ref: VMS Compilation-Footnote-11256714
-Node: VMS Dynamic Extensions1256772
-Node: VMS Installation Details1258457
-Node: VMS Running1260710
-Node: VMS GNV1264989
-Node: VMS Old Gawk1265724
-Node: Bugs1266195
-Node: Bug address1266858
-Node: Usenet1269840
-Node: Maintainers1270844
-Node: Other Versions1272029
-Node: Installation summary1279894
-Node: Notes1281103
-Node: Compatibility Mode1281897
-Node: Additions1282679
-Node: Accessing The Source1283604
-Node: Adding Code1285041
-Node: New Ports1291260
-Node: Derived Files1295635
-Ref: Derived Files-Footnote-11301295
-Ref: Derived Files-Footnote-21301330
-Ref: Derived Files-Footnote-31301928
-Node: Future Extensions1302042
-Node: Implementation Limitations1302700
-Node: Extension Design1303910
-Node: Old Extension Problems1305054
-Ref: Old Extension Problems-Footnote-11306572
-Node: Extension New Mechanism Goals1306629
-Ref: Extension New Mechanism Goals-Footnote-11309993
-Node: Extension Other Design Decisions1310182
-Node: Extension Future Growth1312295
-Node: Notes summary1312901
-Node: Basic Concepts1314059
-Node: Basic High Level1314740
-Ref: figure-general-flow1315022
-Ref: figure-process-flow1315707
-Ref: Basic High Level-Footnote-11319008
-Node: Basic Data Typing1319193
-Node: Glossary1322521
-Node: Copying1354406
-Node: GNU Free Documentation License1391949
-Node: Index1417069
+Ref: Controlling Scanning-Footnote-1522236
+Node: Numeric Array Subscripts522552
+Node: Uninitialized Subscripts524736
+Node: Delete526355
+Ref: Delete-Footnote-1529107
+Node: Multidimensional529164
+Node: Multiscanning532259
+Node: Arrays of Arrays533850
+Node: Arrays Summary538618
+Node: Functions540711
+Node: Built-in541749
+Node: Calling Built-in542902
+Node: Boolean Functions544898
+Node: Numeric Functions545450
+Ref: Numeric Functions-Footnote-1549477
+Ref: Numeric Functions-Footnote-2550125
+Ref: Numeric Functions-Footnote-3550173
+Node: String Functions550445
+Ref: String Functions-Footnote-1574586
+Ref: String Functions-Footnote-2574714
+Ref: String Functions-Footnote-3574962
+Node: Gory Details575049
+Ref: table-sub-escapes576840
+Ref: table-sub-proposed578359
+Ref: table-posix-sub579722
+Ref: table-gensub-escapes581263
+Ref: Gory Details-Footnote-1582086
+Node: I/O Functions582240
+Ref: table-system-return-values588694
+Ref: I/O Functions-Footnote-1590774
+Ref: I/O Functions-Footnote-2590922
+Node: Time Functions591042
+Ref: Time Functions-Footnote-1601713
+Ref: Time Functions-Footnote-2601781
+Ref: Time Functions-Footnote-3601939
+Ref: Time Functions-Footnote-4602050
+Ref: Time Functions-Footnote-5602162
+Ref: Time Functions-Footnote-6602389
+Node: Bitwise Functions602655
+Ref: table-bitwise-ops603249
+Ref: Bitwise Functions-Footnote-1609312
+Ref: Bitwise Functions-Footnote-2609485
+Node: Type Functions609676
+Node: I18N Functions612630
+Node: User-defined614281
+Node: Definition Syntax615093
+Ref: Definition Syntax-Footnote-1620787
+Node: Function Example620858
+Ref: Function Example-Footnote-1623780
+Node: Function Calling623802
+Node: Calling A Function624390
+Node: Variable Scope625348
+Node: Pass By Value/Reference628342
+Node: Function Caveats630986
+Ref: Function Caveats-Footnote-1633033
+Node: Return Statement633153
+Node: Dynamic Typing636132
+Node: Indirect Calls637062
+Ref: Indirect Calls-Footnote-1647317
+Node: Functions Summary647445
+Node: Library Functions650150
+Ref: Library Functions-Footnote-1653757
+Ref: Library Functions-Footnote-2653900
+Node: Library Names654071
+Ref: Library Names-Footnote-1657738
+Ref: Library Names-Footnote-2657961
+Node: General Functions658047
+Node: Strtonum Function659150
+Node: Assert Function662172
+Node: Round Function665498
+Node: Cliff Random Function667038
+Node: Ordinal Functions668054
+Ref: Ordinal Functions-Footnote-1671117
+Ref: Ordinal Functions-Footnote-2671369
+Node: Join Function671579
+Ref: Join Function-Footnote-1673349
+Node: Getlocaltime Function673549
+Node: Readfile Function677291
+Node: Shell Quoting679268
+Node: Data File Management680669
+Node: Filetrans Function681301
+Node: Rewind Function685397
+Node: File Checking687306
+Ref: File Checking-Footnote-1688640
+Node: Empty Files688841
+Node: Ignoring Assigns690820
+Node: Getopt Function692370
+Ref: Getopt Function-Footnote-1707581
+Node: Passwd Functions707781
+Ref: Passwd Functions-Footnote-1716620
+Node: Group Functions716708
+Ref: Group Functions-Footnote-1724606
+Node: Walking Arrays724813
+Node: Library Functions Summary727821
+Node: Library Exercises729227
+Node: Sample Programs729692
+Node: Running Examples730462
+Node: Clones731190
+Node: Cut Program732414
+Node: Egrep Program742554
+Node: Id Program751555
+Node: Split Program761502
+Ref: Split Program-Footnote-1771392
+Node: Tee Program771565
+Node: Uniq Program774355
+Node: Wc Program781943
+Node: Bytes vs. Characters782330
+Node: Using extensions783878
+Node: wc program784632
+Node: Miscellaneous Programs789497
+Node: Dupword Program790710
+Node: Alarm Program792740
+Node: Translate Program797595
+Ref: Translate Program-Footnote-1802160
+Node: Labels Program802430
+Ref: Labels Program-Footnote-1805781
+Node: Word Sorting805865
+Node: History Sorting809937
+Node: Extract Program812162
+Node: Simple Sed820216
+Node: Igawk Program823290
+Ref: Igawk Program-Footnote-1837621
+Ref: Igawk Program-Footnote-2837823
+Ref: Igawk Program-Footnote-3837945
+Node: Anagram Program838060
+Node: Signature Program841122
+Node: Programs Summary842369
+Node: Programs Exercises843583
+Ref: Programs Exercises-Footnote-1847713
+Node: Advanced Features847799
+Node: Nondecimal Data849930
+Node: Boolean Typed Values851528
+Node: Array Sorting853402
+Node: Controlling Array Traversal854107
+Ref: Controlling Array Traversal-Footnote-1862475
+Node: Array Sorting Functions862593
+Ref: Array Sorting Functions-Footnote-1867684
+Node: Two-way I/O867880
+Ref: Two-way I/O-Footnote-1875601
+Ref: Two-way I/O-Footnote-2875788
+Node: TCP/IP Networking875870
+Node: Profiling878988
+Node: Extension Philosophy888297
+Node: Advanced Features Summary889776
+Node: Internationalization891791
+Node: I18N and L10N893271
+Node: Explaining gettext893958
+Ref: Explaining gettext-Footnote-1899850
+Ref: Explaining gettext-Footnote-2900035
+Node: Programmer i18n900200
+Ref: Programmer i18n-Footnote-1905149
+Node: Translator i18n905198
+Node: String Extraction905992
+Ref: String Extraction-Footnote-1907124
+Node: Printf Ordering907210
+Ref: Printf Ordering-Footnote-1909996
+Node: I18N Portability910060
+Ref: I18N Portability-Footnote-1912516
+Node: I18N Example912579
+Ref: I18N Example-Footnote-1915854
+Ref: I18N Example-Footnote-2915927
+Node: Gawk I18N916036
+Node: I18N Summary916685
+Node: Debugger918026
+Node: Debugging919026
+Node: Debugging Concepts919467
+Node: Debugging Terms921276
+Node: Awk Debugging923851
+Ref: Awk Debugging-Footnote-1924796
+Node: Sample Debugging Session924928
+Node: Debugger Invocation925462
+Node: Finding The Bug926848
+Node: List of Debugger Commands933322
+Node: Breakpoint Control934655
+Node: Debugger Execution Control938349
+Node: Viewing And Changing Data941711
+Node: Execution Stack945252
+Node: Debugger Info946889
+Node: Miscellaneous Debugger Commands950960
+Node: Readline Support956022
+Node: Limitations956918
+Node: Debugging Summary959472
+Node: Namespaces960751
+Node: Global Namespace961862
+Node: Qualified Names963260
+Node: Default Namespace964259
+Node: Changing The Namespace965000
+Node: Naming Rules966614
+Node: Internal Name Management968462
+Node: Namespace Example969504
+Node: Namespace And Features972066
+Node: Namespace Summary973501
+Node: Arbitrary Precision Arithmetic974978
+Node: Computer Arithmetic976465
+Ref: table-numeric-ranges980231
+Ref: table-floating-point-ranges980724
+Ref: Computer Arithmetic-Footnote-1981382
+Node: Math Definitions981439
+Ref: table-ieee-formats984415
+Node: MPFR features984982
+Node: FP Math Caution986700
+Ref: FP Math Caution-Footnote-1987772
+Node: Inexactness of computations988141
+Node: Inexact representation989172
+Node: Comparing FP Values990532
+Node: Errors accumulate991773
+Node: Strange values993229
+Ref: Strange values-Footnote-1995817
+Node: Getting Accuracy995922
+Node: Try To Round998632
+Node: Setting precision999531
+Ref: table-predefined-precision-strings1000228
+Node: Setting the rounding mode1002058
+Ref: table-gawk-rounding-modes1002432
+Ref: Setting the rounding mode-Footnote-11006363
+Node: Arbitrary Precision Integers1006542
+Ref: Arbitrary Precision Integers-Footnote-11009717
+Node: Checking for MPFR1009866
+Node: POSIX Floating Point Problems1011340
+Ref: POSIX Floating Point Problems-Footnote-11015625
+Node: Floating point summary1015663
+Node: Dynamic Extensions1017853
+Node: Extension Intro1019406
+Node: Plugin License1020672
+Node: Extension Mechanism Outline1021469
+Ref: figure-load-extension1021908
+Ref: figure-register-new-function1023473
+Ref: figure-call-new-function1024565
+Node: Extension API Description1026627
+Node: Extension API Functions Introduction1028340
+Ref: table-api-std-headers1030176
+Node: General Data Types1034425
+Ref: General Data Types-Footnote-11043131
+Node: Memory Allocation Functions1043430
+Ref: Memory Allocation Functions-Footnote-11047931
+Node: Constructor Functions1048030
+Node: API Ownership of MPFR and GMP Values1051683
+Node: Registration Functions1052996
+Node: Extension Functions1053696
+Node: Exit Callback Functions1059018
+Node: Extension Version String1060268
+Node: Input Parsers1060931
+Node: Output Wrappers1073652
+Node: Two-way processors1078164
+Node: Printing Messages1080429
+Ref: Printing Messages-Footnote-11081600
+Node: Updating ERRNO1081753
+Node: Requesting Values1082492
+Ref: table-value-types-returned1083229
+Node: Accessing Parameters1084337
+Node: Symbol Table Access1085574
+Node: Symbol table by name1086086
+Ref: Symbol table by name-Footnote-11089110
+Node: Symbol table by cookie1089238
+Ref: Symbol table by cookie-Footnote-11093423
+Node: Cached values1093487
+Ref: Cached values-Footnote-11097023
+Node: Array Manipulation1097176
+Ref: Array Manipulation-Footnote-11098267
+Node: Array Data Types1098304
+Ref: Array Data Types-Footnote-11100962
+Node: Array Functions1101054
+Node: Flattening Arrays1105552
+Node: Creating Arrays1112528
+Node: Redirection API1117295
+Node: Extension API Variables1120128
+Node: Extension Versioning1120839
+Ref: gawk-api-version1121268
+Node: Extension GMP/MPFR Versioning1122999
+Node: Extension API Informational Variables1124627
+Node: Extension API Boilerplate1125700
+Node: Changes from API V11129674
+Node: Finding Extensions1131246
+Node: Extension Example1131805
+Node: Internal File Description1132603
+Node: Internal File Ops1136683
+Ref: Internal File Ops-Footnote-11148033
+Node: Using Internal File Ops1148173
+Ref: Using Internal File Ops-Footnote-11150556
+Node: Extension Samples1150830
+Node: Extension Sample File Functions1152359
+Node: Extension Sample Fnmatch1160008
+Node: Extension Sample Fork1161495
+Node: Extension Sample Inplace1162713
+Node: Extension Sample Ord1166339
+Node: Extension Sample Readdir1167175
+Ref: table-readdir-file-types1168064
+Node: Extension Sample Revout1169131
+Node: Extension Sample Rev2way1169720
+Node: Extension Sample Read write array1170460
+Node: Extension Sample Readfile1172402
+Node: Extension Sample Time1173497
+Node: Extension Sample API Tests1175249
+Node: gawkextlib1175741
+Node: Extension summary1178659
+Node: Extension Exercises1182361
+Node: Language History1183603
+Node: V7/SVR3.11185259
+Node: SVR41187411
+Node: POSIX1188845
+Node: BTL1190226
+Node: POSIX/GNU1190955
+Node: Feature History1196733
+Node: Common Extensions1213052
+Node: Ranges and Locales1214335
+Ref: Ranges and Locales-Footnote-11218951
+Ref: Ranges and Locales-Footnote-21218978
+Ref: Ranges and Locales-Footnote-31219213
+Node: Contributors1219436
+Node: History summary1225433
+Node: Installation1226813
+Node: Gawk Distribution1227757
+Node: Getting1228241
+Node: Extracting1229204
+Node: Distribution contents1230842
+Node: Unix Installation1237322
+Node: Quick Installation1238004
+Node: Shell Startup Files1240418
+Node: Additional Configuration Options1241507
+Node: Configuration Philosophy1243822
+Node: Non-Unix Installation1246191
+Node: PC Installation1246651
+Node: PC Binary Installation1247489
+Node: PC Compiling1247924
+Node: PC Using1249041
+Node: Cygwin1252594
+Node: MSYS1253818
+Node: VMS Installation1254420
+Node: VMS Compilation1255211
+Ref: VMS Compilation-Footnote-11256440
+Node: VMS Dynamic Extensions1256498
+Node: VMS Installation Details1258183
+Node: VMS Running1260436
+Node: VMS GNV1264715
+Node: VMS Old Gawk1265450
+Node: Bugs1265921
+Node: Bug address1266584
+Node: Usenet1269566
+Node: Maintainers1270570
+Node: Other Versions1271755
+Node: Installation summary1279620
+Node: Notes1280829
+Node: Compatibility Mode1281623
+Node: Additions1282405
+Node: Accessing The Source1283330
+Node: Adding Code1284767
+Node: New Ports1290986
+Node: Derived Files1295361
+Ref: Derived Files-Footnote-11301021
+Ref: Derived Files-Footnote-21301056
+Ref: Derived Files-Footnote-31301654
+Node: Future Extensions1301768
+Node: Implementation Limitations1302426
+Node: Extension Design1303636
+Node: Old Extension Problems1304780
+Ref: Old Extension Problems-Footnote-11306298
+Node: Extension New Mechanism Goals1306355
+Ref: Extension New Mechanism Goals-Footnote-11309719
+Node: Extension Other Design Decisions1309908
+Node: Extension Future Growth1312021
+Node: Notes summary1312627
+Node: Basic Concepts1313785
+Node: Basic High Level1314466
+Ref: figure-general-flow1314748
+Ref: figure-process-flow1315433
+Ref: Basic High Level-Footnote-11318734
+Node: Basic Data Typing1318919
+Node: Glossary1322247
+Node: Copying1354134
+Node: GNU Free Documentation License1391677
+Node: Index1416797
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 888973e..06c3d90 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -17515,8 +17515,7 @@ Any index with a non-numeric value will end up
positioned as if it were zero.
Order by element values in ascending order (rather than by indices).
Ordering is by the type assigned to the element
(@pxref{Typing and Comparison}).
-All Boolean values come before all numeric values (@pxref{Boolean Typed
Values}),
-and all numeric values come before all string values,
+All numeric values come before all string values,
which in turn come before all subarrays.
(Subarrays have not been described yet;
@pxref{Arrays of Arrays}.)
@@ -18394,9 +18393,9 @@ available in compatibility mode (@pxref{Options}):
@item @code{bool(@var{expression})}
@cindexgawkfunc{bool}
Return a Boolean-typed value based on the regular Boolean value
-of @var{expression}. Boolean ``true'' values have numeric value one
-and string value @code{"TRUE"}. Boolean ``false'' values have numeric
-zero and string value @code{"FALSE"}. This is discussed in more
+of @var{expression}. Boolean ``true'' values have numeric value one.
+Boolean ``false'' values have numeric
+zero. This is discussed in more
detail in @ref{Boolean Typed Values}.
@end table
@@ -20916,15 +20915,15 @@ Return one of the following strings, depending upon
the type of @var{x}:
@item "array"
@var{x} is an array.
-@item "bool"
-@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
-
@item "regexp"
@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}).
@item "number"
@var{x} is a number.
+@item "number|bool"
+@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
+
@item "string"
@var{x} is a string.
@@ -29412,7 +29411,7 @@ discusses the ability to dynamically add new built-in
functions to
@menu
* Nondecimal Data:: Allowing nondecimal input data.
-* Boolean Typed Values:: Values with @code{bool} type.
+* Boolean Typed Values:: Values with @code{number|bool} type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -29504,16 +29503,18 @@ To solve this problem, @command{gawk} provides a
function named @code{bool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-The returned values are different than normal @command{awk} values. When
-treated as numbers, they are either one or zero, depending upon the truth
-value of the original expression passed in the call to @code{bool()}. When
-treated as strings, they are either @code{"TRUE"} or @code{"FALSE"},
-again depending upon the truth value of the expression passed in the
-call to @code{bool()}. The value for ``false'' is thus unusual; it is
-zero numerically, but not empty when treated as a string.
+@c HERE
+The returned values are normal @command{awk} numeric values, with
+values of either one or zero,
+depending upon the truth
+value of the original expression passed in the call to @code{bool()}.
The @code{typeof()} function (@pxref{Type Functions}) returns
-@code{"bool"} for these values.
+@code{"number|bool"} for these values.
+
+Thus Boolean-typed values @emph{are} numbers as far as @command{gawk}
+is concerned, except that extension code can treat them as Booleans
+if desired.
While it would have been possible to add two new built-in variables
of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
@@ -45304,8 +45305,8 @@ internationalized program to work in a particular
language.
@item Logical Expression
An expression using the operators for logic, AND, OR, and NOT, written
-@samp{&&}, @samp{||}, and @samp{!} in @command{awk}. Often called Boolean
-expressions, after the mathematician who pioneered this kind of
+@samp{&&}, @samp{||}, and @samp{!} in @command{awk}. Often called @dfn{Boolean
+expressions}, after the mathematician who pioneered this kind of
mathematical logic.
@item Lvalue
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index b1eca3b..57a87eb 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -16656,8 +16656,7 @@ Any index with a non-numeric value will end up
positioned as if it were zero.
Order by element values in ascending order (rather than by indices).
Ordering is by the type assigned to the element
(@pxref{Typing and Comparison}).
-All Boolean values come before all numeric values (@pxref{Boolean Typed
Values}),
-and all numeric values come before all string values,
+All numeric values come before all string values,
which in turn come before all subarrays.
(Subarrays have not been described yet;
@pxref{Arrays of Arrays}.)
@@ -17535,9 +17534,9 @@ available in compatibility mode (@pxref{Options}):
@item @code{bool(@var{expression})}
@cindexgawkfunc{bool}
Return a Boolean-typed value based on the regular Boolean value
-of @var{expression}. Boolean ``true'' values have numeric value one
-and string value @code{"TRUE"}. Boolean ``false'' values have numeric
-zero and string value @code{"FALSE"}. This is discussed in more
+of @var{expression}. Boolean ``true'' values have numeric value one.
+Boolean ``false'' values have numeric
+zero. This is discussed in more
detail in @ref{Boolean Typed Values}.
@end table
@@ -19828,15 +19827,15 @@ Return one of the following strings, depending upon
the type of @var{x}:
@item "array"
@var{x} is an array.
-@item "bool"
-@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
-
@item "regexp"
@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}).
@item "number"
@var{x} is a number.
+@item "number|bool"
+@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
+
@item "string"
@var{x} is a string.
@@ -28294,7 +28293,7 @@ discusses the ability to dynamically add new built-in
functions to
@menu
* Nondecimal Data:: Allowing nondecimal input data.
-* Boolean Typed Values:: Values with @code{bool} type.
+* Boolean Typed Values:: Values with @code{number|bool} type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -28386,16 +28385,18 @@ To solve this problem, @command{gawk} provides a
function named @code{bool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-The returned values are different than normal @command{awk} values. When
-treated as numbers, they are either one or zero, depending upon the truth
-value of the original expression passed in the call to @code{bool()}. When
-treated as strings, they are either @code{"TRUE"} or @code{"FALSE"},
-again depending upon the truth value of the expression passed in the
-call to @code{bool()}. The value for ``false'' is thus unusual; it is
-zero numerically, but not empty when treated as a string.
+@c HERE
+The returned values are normal @command{awk} numeric values, with
+values of either one or zero,
+depending upon the truth
+value of the original expression passed in the call to @code{bool()}.
The @code{typeof()} function (@pxref{Type Functions}) returns
-@code{"bool"} for these values.
+@code{"number|bool"} for these values.
+
+Thus Boolean-typed values @emph{are} numbers as far as @command{gawk}
+is concerned, except that extension code can treat them as Booleans
+if desired.
While it would have been possible to add two new built-in variables
of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
@@ -44147,8 +44148,8 @@ internationalized program to work in a particular
language.
@item Logical Expression
An expression using the operators for logic, AND, OR, and NOT, written
-@samp{&&}, @samp{||}, and @samp{!} in @command{awk}. Often called Boolean
-expressions, after the mathematician who pioneered this kind of
+@samp{&&}, @samp{||}, and @samp{!} in @command{awk}. Often called @dfn{Boolean
+expressions}, after the mathematician who pioneered this kind of
mathematical logic.
@item Lvalue
diff --git a/field.c b/field.c
index 2bd5886..c21046b 100644
--- a/field.c
+++ b/field.c
@@ -1019,7 +1019,6 @@ do_split(int nargs)
assoc_clear(arr);
src = TOP_STRING();
- warn_bool("split", 1, src);
if (src->stlen == 0) {
/*
* Skip the work if first arg is the null string.
@@ -1097,7 +1096,6 @@ do_patsplit(int nargs)
_("%s: cannot use %s as second argument"));
src = TOP_STRING();
- warn_bool("patsplit", 1, src);
if ((sep->flags & REGEX) != 0)
sep = sep->typed_re;
diff --git a/gawkapi.c b/gawkapi.c
index e8a9c31..cdae4d5 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -600,7 +600,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case AWK_STRNUM:
switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case BOOL:
+ case NUMBER|BOOL:
val->val_type = AWK_BOOL;
break;
case STRING:
@@ -640,7 +640,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case STRING:
val->val_type = AWK_STRING;
break;
- case BOOL:
+ case NUMBER|BOOL:
val->val_type = AWK_BOOL;
break;
case NUMBER:
@@ -668,7 +668,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case AWK_SCALAR:
switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case BOOL:
+ case NUMBER|BOOL:
val->val_type = AWK_BOOL;
break;
case STRING:
@@ -699,7 +699,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case AWK_UNDEFINED:
/* return true and actual type for request of undefined
*/
switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case BOOL:
+ case NUMBER|BOOL:
assign_bool(node, val);
ret = awk_true;
break;
diff --git a/node.c b/node.c
index dda90f0..cbf5c56 100644
--- a/node.c
+++ b/node.c
@@ -1092,13 +1092,12 @@ make_bool_node(bool value)
const char *sval;
AWKNUM nval;
- sval = (value ? "TRUE" : "FALSE");
+ sval = (value ? "1" : "0");
nval = (value ? 1.0 : 0.0);
val = make_number(nval);
val->stptr = estrdup(sval, strlen(sval));
val->stlen = strlen(sval);
- val->flags &= ~NUMBER;
val->flags |= NUMCUR|STRCUR|BOOL;
val->stfmt = STFMT_UNUSED;
diff --git a/test/ChangeLog b/test/ChangeLog
index b357485..6ae679e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * asortbool.ok: Revise after code changes.
+ * rwarray.awk: Ditto.
+
2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
* noeffect.awk: Add more test cases. Thanks to Wolfgang Laun
diff --git a/test/asortbool.ok b/test/asortbool.ok
index de08a77..623e417 100644
--- a/test/asortbool.ok
+++ b/test/asortbool.ok
@@ -1,6 +1,6 @@
-1, bool: FALSE
-2, bool: TRUE
-3, number: -45
+1, number: -45
+2, number|bool: 0
+3, number|bool: 1
4, number: 45
5, string: foo
6, array: 47
diff --git a/test/rwarray.awk b/test/rwarray.awk
index 831f17c..b868fa4 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -55,11 +55,11 @@ BEGIN {
printf("dict[\"%s\"] should be strnum, is %s\n",
strnum_sub, typeof(dict[strnum_sub]));
- if (typeof(dict[bool_sub]) != "bool")
- printf("dict[\"%s\"] should be bool, is %s\n",
+ if (typeof(dict[bool_sub]) != "number|bool")
+ printf("dict[\"%s\"] should be number|bool, is %s\n",
bool_sub, typeof(dict[bool_sub]));
- if ((dict[bool_sub] "") != "TRUE")
- printf("dict[\"%s\"] should be TRUE, is %s\n",
+ if ((dict[bool_sub] "") != "1")
+ printf("dict[\"%s\"] should be 1, is %s\n",
bool_sub, dict[bool_sub]);
}
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=3a530fc2d0a257536d67ffa854bc8c3ecf96acb1
commit 3a530fc2d0a257536d67ffa854bc8c3ecf96acb1
Merge: 92c5c36 ce909dd
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Apr 25 10:28:38 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=92c5c36bc42aa1ccf6ccc8defc4f372b6de92111
commit 92c5c36bc42aa1ccf6ccc8defc4f372b6de92111
Merge: 26cd77b 3057064
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri Apr 23 13:46:54 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=26cd77bdc2735d62eb664291dc9912dbaaa78c2c
commit 26cd77bdc2735d62eb664291dc9912dbaaa78c2c
Merge: 1d13100 7caf36a
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri Apr 23 11:42:24 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1d13100417c33bb36afae0c5972a456d183f0b49
commit 1d13100417c33bb36afae0c5972a456d183f0b49
Merge: a74c335 0c45cd1
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Apr 21 22:58:14 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a74c335ac8fd253f8c67cd4c54adef13dd3c6d73
commit a74c335ac8fd253f8c67cd4c54adef13dd3c6d73
Merge: 0a59aaa 5e746ef
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri Apr 16 18:03:19 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0a59aaa174784ed6ef7166332670b860ee8054bb
commit 0a59aaa174784ed6ef7166332670b860ee8054bb
Merge: 752de8b 7d775b9
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Apr 14 17:37:11 2021 +0300
Merge branch 'master' into feature/bool
diff --cc ChangeLog
index 643bb18,9b742db..255898f
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,20 -1,18 +1,35 @@@
2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
+ Fix up lint warnings for "no effect" to avoid false warnings.
+ Straighten out the messages, and remove the run-time warning,
+ since a parse-time warning is already issued. Thanks to
+ Arkadiusz Drabczyk <arkadiusz@drabczyk.org> for the initial
+ bug report.
+
+ * awkgram.y (isnoeffect): Add more opcodes that are "no effect".
+ (add_lint): For LINT_no_effect, check that all the opcodes in the
+ list are "no effect". Only if so, issue the warning. Remove the
+ addition of the run-time warning.
+ * interpret.h (r_interpret): Remove LINT_no_effect from Op_lint
+ case.
+
++2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
++
+ * array.c (do_sort_up_value_type): Fix order with bools.
+
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk_api.h (gawk_api_minor_version): Increase to 2.
+ * gawk_api.c (+assign_bool): New function.
+ (node_to_awk_value): Finish updating for bool types and values.
+
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h (make_bool): New inline function.
+ Update table of request/return types.
+ * gawkapi.c (awk_value_to_node): Add support for AWK_BOOL.
+ (node_to_awk_value): Start on same. Not yet complete.
+
2021-03-21 Arnold D. Robbins <arnold@skeeve.com>
* str_array.c (fnv1a_hash_string): New function.
diff --cc test/ChangeLog
index a65ff61,641a984..b357485
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@@ -1,14 -1,9 +1,20 @@@
+ 2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * noeffect.awk: Add more test cases. Thanks to Wolfgang Laun
+ <wolfgang.laun@gmail.com>.
+ * lintwarn.ok, noeffect.ok: Updated after code and test changes.
+
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): asortbool, new test.
+ * asortbool.awk, asortbool.ok: New files.
+ * rwarray.awk: Add test of saving/restoring bool values.
+
+2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dumpvars.ok, functab5.ok, id.ok, intest.awk, symtab11.ok,
+ symtab8.ok: Updated after code changes.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): argcasfile, new test.
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=752de8b1a557d3ff7f7c1e3c17104fa165b4c6ca
commit 752de8b1a557d3ff7f7c1e3c17104fa165b4c6ca
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Apr 14 16:33:14 2021 +0300
Finish bool doc, fix sort order.
diff --git a/ChangeLog b/ChangeLog
index e4843cb..643bb18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (do_sort_up_value_type): Fix order with bools.
+
2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
* gawk_api.h (gawk_api_minor_version): Increase to 2.
diff --git a/array.c b/array.c
index b4ce86b..c6bfa44 100644
--- a/array.c
+++ b/array.c
@@ -1214,18 +1214,18 @@ do_sort_up_value_type(const void *p1, const void *p2)
return cmp_numbers(n1, n2);
}
- /* 3b. Numbers next */
- if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) {
- return cmp_numbers(n1, n2);
- }
-
- /* 3c. Bools before everything else */
+ /* 3b. Bools before everything else */
if ((n1->flags & BOOL) != 0 && (n2->flags & BOOL) == 0) {
return -1;
} else if ((n1->flags & BOOL) == 0 && (n2->flags & BOOL) != 0) {
return 1;
}
+ /* 3c. Numbers next */
+ if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) {
+ return cmp_numbers(n1, n2);
+ }
+
/* 3d. All numbers are less than all strings. This is aribitrary. */
if ((n1->flags & NUMBER) != 0 && (n2->flags & STRING) != 0) {
return -1;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 9cf4aa3..6e7ad16 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Controlling Scanning): Document bools for
+ "@val_type_asc".
+ * awkcard.in: Add doc on bool() function.
+
2021-04-06 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Finish documenting bool features.
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 7cf90cc..cf2cf76 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -2,7 +2,7 @@
.\"
.\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
.\" 2005, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
-.\" 2019, 2020
+.\" 2019, 2020, 2021
.\" Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of
@@ -100,7 +100,7 @@ Variables 5\*(CX
\*(CD
.SL
.nf
-\*(FRCopyright \(co 1996\(en2005, 2007, 2009\(en2020
+\*(FRCopyright \(co 1996\(en2005, 2007, 2009\(en2021
Free Software Foundation, Inc.
.nf
.BT
@@ -1916,6 +1916,20 @@ See the manual for details.\*(CB
.EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0"
.BT
+.\" --- Generator Functions
+.ES
+.fi
+.in +.2i
+.ti -.2i
+\*(CD\*(FCbool(\*(FIexpression\*(FC)\*(FR
+.br
+Return a Boolean-typed value based on the Boolean value
+of \*(FIexpression\fP. True values have a numeric value of one
+and a string value of \*(FC"TRUE"\fP. False values have a numeric value of zero
+and a string value of \*(FC"FALSE"\fP.\*(CB
+.in -.2i
+.EB "\s+2\f(HBGENERATOR FUNCTIONS (\*(GK\f(HB)\*(FR\s0"
+.sp .5
.\" --- Type Functions
.ES
.fi
@@ -1959,11 +1973,6 @@ Return the translation of \*(FIstring\*(FR in text domain
\*(FIdomain\*(FR for locale category \*(FIcategory\*(FR.
The default value for \*(FIdomain\*(FR is the current value of
\*(FCTEXTDOMAIN\*(FR.
The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR.
-.sp .5
-If you supply a value for \*(FIcategory\*(FR, it must be a string equal to
-one of the known locale categories.
-You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR
-to use the current domain.
.ti -.2i
\*(FCdcngettext(\*(FIstring1\*(FC, \*(FIstring2\*(FC, \*(FInumber\*(FR [\*(FC,
\*(FIdom \*(FR[\*(FC, \*(FIcat\*(FR]]\*(FC)\*(FR
.br
@@ -1971,12 +1980,7 @@ Return the plural form used for \*(FInumber\*(FR of the
translation of
\*(FIstring1\*(FR and \*(FIstring2\*(FR in text domain
\*(FIdom\*(FR for locale category \*(FIcat\*(FR.
The default value for \*(FIdom\*(FR is the current value of
\*(FCTEXTDOMAIN\*(FR.
-The default for \*(FIcat\*(FR is \*(FC"LC_MESSAGES"\*(FR.
-.sp .5
-If you supply a value for \*(FIcat\*(FR, it must be a string equal to
-one of the known locale categories.
-You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR
-to use the current domain.\*(CB
+The default for \*(FIcat\*(FR is \*(FC"LC_MESSAGES"\*(FR.\*(CB
.in -.2i
.EB "\s+2\f(HBINTERNATIONALIZATION (\*(GK\f(HB)\*(FR\s0"
.sp .5
@@ -2012,7 +2016,7 @@ maintains it.\*(CX
.ES
.fi
\*(CDCopyright \(co 1996\(en2005,
-2007, 2009\(en2020 Free Software Foundation, Inc.
+2007, 2009\(en2021 Free Software Foundation, Inc.
.sp .5
Permission is granted to make and distribute verbatim copies of this
reference card provided the copyright notice and this permission notice
diff --git a/doc/gawk.info b/doc/gawk.info
index 008160c..853014f 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12151,9 +12151,11 @@ available:
'"@val_type_asc"'
Order by element values in ascending order (rather than by
indices). Ordering is by the type assigned to the element (*note
- Typing and Comparison::). All numeric values come before all
- string values, which in turn come before all subarrays. (Subarrays
- have not been described yet; *note Arrays of Arrays::.)
+ Typing and Comparison::). All Boolean values come before all
+ numeric values (*note Boolean Typed Values::), and all numeric
+ values come before all string values, which in turn come before all
+ subarrays. (Subarrays have not been described yet; *note Arrays of
+ Arrays::.)
If you choose to use this feature in traversing 'FUNCTAB' (*note
Auto-set::), then the order is built-in functions first (*note
@@ -38424,377 +38426,377 @@ Node: Assigning Elements510508
Node: Array Example510999
Node: Scanning an Array512758
Node: Controlling Scanning515780
-Ref: Controlling Scanning-Footnote-1522236
-Node: Numeric Array Subscripts522552
-Node: Uninitialized Subscripts524736
-Node: Delete526355
-Ref: Delete-Footnote-1529107
-Node: Multidimensional529164
-Node: Multiscanning532259
-Node: Arrays of Arrays533850
-Node: Arrays Summary538618
-Node: Functions540711
-Node: Built-in541749
-Node: Calling Built-in542902
-Node: Boolean Functions544898
-Node: Numeric Functions545508
-Ref: Numeric Functions-Footnote-1549535
-Ref: Numeric Functions-Footnote-2550183
-Ref: Numeric Functions-Footnote-3550231
-Node: String Functions550503
-Ref: String Functions-Footnote-1574644
-Ref: String Functions-Footnote-2574772
-Ref: String Functions-Footnote-3575020
-Node: Gory Details575107
-Ref: table-sub-escapes576898
-Ref: table-sub-proposed578417
-Ref: table-posix-sub579780
-Ref: table-gensub-escapes581321
-Ref: Gory Details-Footnote-1582144
-Node: I/O Functions582298
-Ref: table-system-return-values588752
-Ref: I/O Functions-Footnote-1590832
-Ref: I/O Functions-Footnote-2590980
-Node: Time Functions591100
-Ref: Time Functions-Footnote-1601771
-Ref: Time Functions-Footnote-2601839
-Ref: Time Functions-Footnote-3601997
-Ref: Time Functions-Footnote-4602108
-Ref: Time Functions-Footnote-5602220
-Ref: Time Functions-Footnote-6602447
-Node: Bitwise Functions602713
-Ref: table-bitwise-ops603307
-Ref: Bitwise Functions-Footnote-1609370
-Ref: Bitwise Functions-Footnote-2609543
-Node: Type Functions609734
-Node: I18N Functions612681
-Node: User-defined614332
-Node: Definition Syntax615144
-Ref: Definition Syntax-Footnote-1620838
-Node: Function Example620909
-Ref: Function Example-Footnote-1623831
-Node: Function Calling623853
-Node: Calling A Function624441
-Node: Variable Scope625399
-Node: Pass By Value/Reference628393
-Node: Function Caveats631037
-Ref: Function Caveats-Footnote-1633084
-Node: Return Statement633204
-Node: Dynamic Typing636183
-Node: Indirect Calls637113
-Ref: Indirect Calls-Footnote-1647368
-Node: Functions Summary647496
-Node: Library Functions650201
-Ref: Library Functions-Footnote-1653808
-Ref: Library Functions-Footnote-2653951
-Node: Library Names654122
-Ref: Library Names-Footnote-1657789
-Ref: Library Names-Footnote-2658012
-Node: General Functions658098
-Node: Strtonum Function659201
-Node: Assert Function662223
-Node: Round Function665549
-Node: Cliff Random Function667089
-Node: Ordinal Functions668105
-Ref: Ordinal Functions-Footnote-1671168
-Ref: Ordinal Functions-Footnote-2671420
-Node: Join Function671630
-Ref: Join Function-Footnote-1673400
-Node: Getlocaltime Function673600
-Node: Readfile Function677342
-Node: Shell Quoting679319
-Node: Data File Management680720
-Node: Filetrans Function681352
-Node: Rewind Function685448
-Node: File Checking687357
-Ref: File Checking-Footnote-1688691
-Node: Empty Files688892
-Node: Ignoring Assigns690871
-Node: Getopt Function692421
-Ref: Getopt Function-Footnote-1707632
-Node: Passwd Functions707832
-Ref: Passwd Functions-Footnote-1716671
-Node: Group Functions716759
-Ref: Group Functions-Footnote-1724657
-Node: Walking Arrays724864
-Node: Library Functions Summary727872
-Node: Library Exercises729278
-Node: Sample Programs729743
-Node: Running Examples730513
-Node: Clones731241
-Node: Cut Program732465
-Node: Egrep Program742605
-Node: Id Program751606
-Node: Split Program761553
-Ref: Split Program-Footnote-1771443
-Node: Tee Program771616
-Node: Uniq Program774406
-Node: Wc Program781994
-Node: Bytes vs. Characters782381
-Node: Using extensions783929
-Node: wc program784683
-Node: Miscellaneous Programs789548
-Node: Dupword Program790761
-Node: Alarm Program792791
-Node: Translate Program797646
-Ref: Translate Program-Footnote-1802211
-Node: Labels Program802481
-Ref: Labels Program-Footnote-1805832
-Node: Word Sorting805916
-Node: History Sorting809988
-Node: Extract Program812213
-Node: Simple Sed820267
-Node: Igawk Program823341
-Ref: Igawk Program-Footnote-1837672
-Ref: Igawk Program-Footnote-2837874
-Ref: Igawk Program-Footnote-3837996
-Node: Anagram Program838111
-Node: Signature Program841173
-Node: Programs Summary842420
-Node: Programs Exercises843634
-Ref: Programs Exercises-Footnote-1847764
-Node: Advanced Features847850
-Node: Nondecimal Data849974
-Node: Boolean Typed Values851572
-Node: Array Sorting853580
-Node: Controlling Array Traversal854285
-Ref: Controlling Array Traversal-Footnote-1862653
-Node: Array Sorting Functions862771
-Ref: Array Sorting Functions-Footnote-1867862
-Node: Two-way I/O868058
-Ref: Two-way I/O-Footnote-1875779
-Ref: Two-way I/O-Footnote-2875966
-Node: TCP/IP Networking876048
-Node: Profiling879166
-Node: Extension Philosophy888475
-Node: Advanced Features Summary889954
-Node: Internationalization891969
-Node: I18N and L10N893449
-Node: Explaining gettext894136
-Ref: Explaining gettext-Footnote-1900028
-Ref: Explaining gettext-Footnote-2900213
-Node: Programmer i18n900378
-Ref: Programmer i18n-Footnote-1905327
-Node: Translator i18n905376
-Node: String Extraction906170
-Ref: String Extraction-Footnote-1907302
-Node: Printf Ordering907388
-Ref: Printf Ordering-Footnote-1910174
-Node: I18N Portability910238
-Ref: I18N Portability-Footnote-1912694
-Node: I18N Example912757
-Ref: I18N Example-Footnote-1916032
-Ref: I18N Example-Footnote-2916105
-Node: Gawk I18N916214
-Node: I18N Summary916863
-Node: Debugger918204
-Node: Debugging919204
-Node: Debugging Concepts919645
-Node: Debugging Terms921454
-Node: Awk Debugging924029
-Ref: Awk Debugging-Footnote-1924974
-Node: Sample Debugging Session925106
-Node: Debugger Invocation925640
-Node: Finding The Bug927026
-Node: List of Debugger Commands933500
-Node: Breakpoint Control934833
-Node: Debugger Execution Control938527
-Node: Viewing And Changing Data941889
-Node: Execution Stack945430
-Node: Debugger Info947067
-Node: Miscellaneous Debugger Commands951138
-Node: Readline Support956200
-Node: Limitations957096
-Node: Debugging Summary959650
-Node: Namespaces960929
-Node: Global Namespace962040
-Node: Qualified Names963438
-Node: Default Namespace964437
-Node: Changing The Namespace965178
-Node: Naming Rules966792
-Node: Internal Name Management968640
-Node: Namespace Example969682
-Node: Namespace And Features972244
-Node: Namespace Summary973679
-Node: Arbitrary Precision Arithmetic975156
-Node: Computer Arithmetic976643
-Ref: table-numeric-ranges980409
-Ref: table-floating-point-ranges980902
-Ref: Computer Arithmetic-Footnote-1981560
-Node: Math Definitions981617
-Ref: table-ieee-formats984593
-Node: MPFR features985160
-Node: FP Math Caution986878
-Ref: FP Math Caution-Footnote-1987950
-Node: Inexactness of computations988319
-Node: Inexact representation989350
-Node: Comparing FP Values990710
-Node: Errors accumulate991951
-Node: Strange values993407
-Ref: Strange values-Footnote-1995995
-Node: Getting Accuracy996100
-Node: Try To Round998810
-Node: Setting precision999709
-Ref: table-predefined-precision-strings1000406
-Node: Setting the rounding mode1002236
-Ref: table-gawk-rounding-modes1002610
-Ref: Setting the rounding mode-Footnote-11006541
-Node: Arbitrary Precision Integers1006720
-Ref: Arbitrary Precision Integers-Footnote-11009895
-Node: Checking for MPFR1010044
-Node: POSIX Floating Point Problems1011518
-Ref: POSIX Floating Point Problems-Footnote-11015803
-Node: Floating point summary1015841
-Node: Dynamic Extensions1018031
-Node: Extension Intro1019584
-Node: Plugin License1020850
-Node: Extension Mechanism Outline1021647
-Ref: figure-load-extension1022086
-Ref: figure-register-new-function1023651
-Ref: figure-call-new-function1024743
-Node: Extension API Description1026805
-Node: Extension API Functions Introduction1028518
-Ref: table-api-std-headers1030354
-Node: General Data Types1034603
-Ref: General Data Types-Footnote-11043309
-Node: Memory Allocation Functions1043608
-Ref: Memory Allocation Functions-Footnote-11048109
-Node: Constructor Functions1048208
-Node: API Ownership of MPFR and GMP Values1051861
-Node: Registration Functions1053174
-Node: Extension Functions1053874
-Node: Exit Callback Functions1059196
-Node: Extension Version String1060446
-Node: Input Parsers1061109
-Node: Output Wrappers1073830
-Node: Two-way processors1078342
-Node: Printing Messages1080607
-Ref: Printing Messages-Footnote-11081778
-Node: Updating ERRNO1081931
-Node: Requesting Values1082670
-Ref: table-value-types-returned1083407
-Node: Accessing Parameters1084515
-Node: Symbol Table Access1085752
-Node: Symbol table by name1086264
-Ref: Symbol table by name-Footnote-11089288
-Node: Symbol table by cookie1089416
-Ref: Symbol table by cookie-Footnote-11093601
-Node: Cached values1093665
-Ref: Cached values-Footnote-11097201
-Node: Array Manipulation1097354
-Ref: Array Manipulation-Footnote-11098445
-Node: Array Data Types1098482
-Ref: Array Data Types-Footnote-11101140
-Node: Array Functions1101232
-Node: Flattening Arrays1105730
-Node: Creating Arrays1112706
-Node: Redirection API1117473
-Node: Extension API Variables1120306
-Node: Extension Versioning1121017
-Ref: gawk-api-version1121446
-Node: Extension GMP/MPFR Versioning1123177
-Node: Extension API Informational Variables1124805
-Node: Extension API Boilerplate1125878
-Node: Changes from API V11129852
-Node: Finding Extensions1131424
-Node: Extension Example1131983
-Node: Internal File Description1132781
-Node: Internal File Ops1136861
-Ref: Internal File Ops-Footnote-11148211
-Node: Using Internal File Ops1148351
-Ref: Using Internal File Ops-Footnote-11150734
-Node: Extension Samples1151008
-Node: Extension Sample File Functions1152537
-Node: Extension Sample Fnmatch1160186
-Node: Extension Sample Fork1161673
-Node: Extension Sample Inplace1162891
-Node: Extension Sample Ord1166517
-Node: Extension Sample Readdir1167353
-Ref: table-readdir-file-types1168242
-Node: Extension Sample Revout1169309
-Node: Extension Sample Rev2way1169898
-Node: Extension Sample Read write array1170638
-Node: Extension Sample Readfile1172580
-Node: Extension Sample Time1173675
-Node: Extension Sample API Tests1175427
-Node: gawkextlib1175919
-Node: Extension summary1178837
-Node: Extension Exercises1182539
-Node: Language History1183781
-Node: V7/SVR3.11185437
-Node: SVR41187589
-Node: POSIX1189023
-Node: BTL1190404
-Node: POSIX/GNU1191133
-Node: Feature History1196911
-Node: Common Extensions1213230
-Node: Ranges and Locales1214513
-Ref: Ranges and Locales-Footnote-11219129
-Ref: Ranges and Locales-Footnote-21219156
-Ref: Ranges and Locales-Footnote-31219391
-Node: Contributors1219614
-Node: History summary1225611
-Node: Installation1226991
-Node: Gawk Distribution1227935
-Node: Getting1228419
-Node: Extracting1229382
-Node: Distribution contents1231020
-Node: Unix Installation1237500
-Node: Quick Installation1238182
-Node: Shell Startup Files1240596
-Node: Additional Configuration Options1241685
-Node: Configuration Philosophy1244000
-Node: Non-Unix Installation1246369
-Node: PC Installation1246829
-Node: PC Binary Installation1247667
-Node: PC Compiling1248102
-Node: PC Using1249219
-Node: Cygwin1252772
-Node: MSYS1253996
-Node: VMS Installation1254598
-Node: VMS Compilation1255389
-Ref: VMS Compilation-Footnote-11256618
-Node: VMS Dynamic Extensions1256676
-Node: VMS Installation Details1258361
-Node: VMS Running1260614
-Node: VMS GNV1264893
-Node: VMS Old Gawk1265628
-Node: Bugs1266099
-Node: Bug address1266762
-Node: Usenet1269744
-Node: Maintainers1270748
-Node: Other Versions1271933
-Node: Installation summary1279798
-Node: Notes1281007
-Node: Compatibility Mode1281801
-Node: Additions1282583
-Node: Accessing The Source1283508
-Node: Adding Code1284945
-Node: New Ports1291164
-Node: Derived Files1295539
-Ref: Derived Files-Footnote-11301199
-Ref: Derived Files-Footnote-21301234
-Ref: Derived Files-Footnote-31301832
-Node: Future Extensions1301946
-Node: Implementation Limitations1302604
-Node: Extension Design1303814
-Node: Old Extension Problems1304958
-Ref: Old Extension Problems-Footnote-11306476
-Node: Extension New Mechanism Goals1306533
-Ref: Extension New Mechanism Goals-Footnote-11309897
-Node: Extension Other Design Decisions1310086
-Node: Extension Future Growth1312199
-Node: Notes summary1312805
-Node: Basic Concepts1313963
-Node: Basic High Level1314644
-Ref: figure-general-flow1314926
-Ref: figure-process-flow1315611
-Ref: Basic High Level-Footnote-11318912
-Node: Basic Data Typing1319097
-Node: Glossary1322425
-Node: Copying1354310
-Node: GNU Free Documentation License1391853
-Node: Index1416973
+Ref: Controlling Scanning-Footnote-1522332
+Node: Numeric Array Subscripts522648
+Node: Uninitialized Subscripts524832
+Node: Delete526451
+Ref: Delete-Footnote-1529203
+Node: Multidimensional529260
+Node: Multiscanning532355
+Node: Arrays of Arrays533946
+Node: Arrays Summary538714
+Node: Functions540807
+Node: Built-in541845
+Node: Calling Built-in542998
+Node: Boolean Functions544994
+Node: Numeric Functions545604
+Ref: Numeric Functions-Footnote-1549631
+Ref: Numeric Functions-Footnote-2550279
+Ref: Numeric Functions-Footnote-3550327
+Node: String Functions550599
+Ref: String Functions-Footnote-1574740
+Ref: String Functions-Footnote-2574868
+Ref: String Functions-Footnote-3575116
+Node: Gory Details575203
+Ref: table-sub-escapes576994
+Ref: table-sub-proposed578513
+Ref: table-posix-sub579876
+Ref: table-gensub-escapes581417
+Ref: Gory Details-Footnote-1582240
+Node: I/O Functions582394
+Ref: table-system-return-values588848
+Ref: I/O Functions-Footnote-1590928
+Ref: I/O Functions-Footnote-2591076
+Node: Time Functions591196
+Ref: Time Functions-Footnote-1601867
+Ref: Time Functions-Footnote-2601935
+Ref: Time Functions-Footnote-3602093
+Ref: Time Functions-Footnote-4602204
+Ref: Time Functions-Footnote-5602316
+Ref: Time Functions-Footnote-6602543
+Node: Bitwise Functions602809
+Ref: table-bitwise-ops603403
+Ref: Bitwise Functions-Footnote-1609466
+Ref: Bitwise Functions-Footnote-2609639
+Node: Type Functions609830
+Node: I18N Functions612777
+Node: User-defined614428
+Node: Definition Syntax615240
+Ref: Definition Syntax-Footnote-1620934
+Node: Function Example621005
+Ref: Function Example-Footnote-1623927
+Node: Function Calling623949
+Node: Calling A Function624537
+Node: Variable Scope625495
+Node: Pass By Value/Reference628489
+Node: Function Caveats631133
+Ref: Function Caveats-Footnote-1633180
+Node: Return Statement633300
+Node: Dynamic Typing636279
+Node: Indirect Calls637209
+Ref: Indirect Calls-Footnote-1647464
+Node: Functions Summary647592
+Node: Library Functions650297
+Ref: Library Functions-Footnote-1653904
+Ref: Library Functions-Footnote-2654047
+Node: Library Names654218
+Ref: Library Names-Footnote-1657885
+Ref: Library Names-Footnote-2658108
+Node: General Functions658194
+Node: Strtonum Function659297
+Node: Assert Function662319
+Node: Round Function665645
+Node: Cliff Random Function667185
+Node: Ordinal Functions668201
+Ref: Ordinal Functions-Footnote-1671264
+Ref: Ordinal Functions-Footnote-2671516
+Node: Join Function671726
+Ref: Join Function-Footnote-1673496
+Node: Getlocaltime Function673696
+Node: Readfile Function677438
+Node: Shell Quoting679415
+Node: Data File Management680816
+Node: Filetrans Function681448
+Node: Rewind Function685544
+Node: File Checking687453
+Ref: File Checking-Footnote-1688787
+Node: Empty Files688988
+Node: Ignoring Assigns690967
+Node: Getopt Function692517
+Ref: Getopt Function-Footnote-1707728
+Node: Passwd Functions707928
+Ref: Passwd Functions-Footnote-1716767
+Node: Group Functions716855
+Ref: Group Functions-Footnote-1724753
+Node: Walking Arrays724960
+Node: Library Functions Summary727968
+Node: Library Exercises729374
+Node: Sample Programs729839
+Node: Running Examples730609
+Node: Clones731337
+Node: Cut Program732561
+Node: Egrep Program742701
+Node: Id Program751702
+Node: Split Program761649
+Ref: Split Program-Footnote-1771539
+Node: Tee Program771712
+Node: Uniq Program774502
+Node: Wc Program782090
+Node: Bytes vs. Characters782477
+Node: Using extensions784025
+Node: wc program784779
+Node: Miscellaneous Programs789644
+Node: Dupword Program790857
+Node: Alarm Program792887
+Node: Translate Program797742
+Ref: Translate Program-Footnote-1802307
+Node: Labels Program802577
+Ref: Labels Program-Footnote-1805928
+Node: Word Sorting806012
+Node: History Sorting810084
+Node: Extract Program812309
+Node: Simple Sed820363
+Node: Igawk Program823437
+Ref: Igawk Program-Footnote-1837768
+Ref: Igawk Program-Footnote-2837970
+Ref: Igawk Program-Footnote-3838092
+Node: Anagram Program838207
+Node: Signature Program841269
+Node: Programs Summary842516
+Node: Programs Exercises843730
+Ref: Programs Exercises-Footnote-1847860
+Node: Advanced Features847946
+Node: Nondecimal Data850070
+Node: Boolean Typed Values851668
+Node: Array Sorting853676
+Node: Controlling Array Traversal854381
+Ref: Controlling Array Traversal-Footnote-1862749
+Node: Array Sorting Functions862867
+Ref: Array Sorting Functions-Footnote-1867958
+Node: Two-way I/O868154
+Ref: Two-way I/O-Footnote-1875875
+Ref: Two-way I/O-Footnote-2876062
+Node: TCP/IP Networking876144
+Node: Profiling879262
+Node: Extension Philosophy888571
+Node: Advanced Features Summary890050
+Node: Internationalization892065
+Node: I18N and L10N893545
+Node: Explaining gettext894232
+Ref: Explaining gettext-Footnote-1900124
+Ref: Explaining gettext-Footnote-2900309
+Node: Programmer i18n900474
+Ref: Programmer i18n-Footnote-1905423
+Node: Translator i18n905472
+Node: String Extraction906266
+Ref: String Extraction-Footnote-1907398
+Node: Printf Ordering907484
+Ref: Printf Ordering-Footnote-1910270
+Node: I18N Portability910334
+Ref: I18N Portability-Footnote-1912790
+Node: I18N Example912853
+Ref: I18N Example-Footnote-1916128
+Ref: I18N Example-Footnote-2916201
+Node: Gawk I18N916310
+Node: I18N Summary916959
+Node: Debugger918300
+Node: Debugging919300
+Node: Debugging Concepts919741
+Node: Debugging Terms921550
+Node: Awk Debugging924125
+Ref: Awk Debugging-Footnote-1925070
+Node: Sample Debugging Session925202
+Node: Debugger Invocation925736
+Node: Finding The Bug927122
+Node: List of Debugger Commands933596
+Node: Breakpoint Control934929
+Node: Debugger Execution Control938623
+Node: Viewing And Changing Data941985
+Node: Execution Stack945526
+Node: Debugger Info947163
+Node: Miscellaneous Debugger Commands951234
+Node: Readline Support956296
+Node: Limitations957192
+Node: Debugging Summary959746
+Node: Namespaces961025
+Node: Global Namespace962136
+Node: Qualified Names963534
+Node: Default Namespace964533
+Node: Changing The Namespace965274
+Node: Naming Rules966888
+Node: Internal Name Management968736
+Node: Namespace Example969778
+Node: Namespace And Features972340
+Node: Namespace Summary973775
+Node: Arbitrary Precision Arithmetic975252
+Node: Computer Arithmetic976739
+Ref: table-numeric-ranges980505
+Ref: table-floating-point-ranges980998
+Ref: Computer Arithmetic-Footnote-1981656
+Node: Math Definitions981713
+Ref: table-ieee-formats984689
+Node: MPFR features985256
+Node: FP Math Caution986974
+Ref: FP Math Caution-Footnote-1988046
+Node: Inexactness of computations988415
+Node: Inexact representation989446
+Node: Comparing FP Values990806
+Node: Errors accumulate992047
+Node: Strange values993503
+Ref: Strange values-Footnote-1996091
+Node: Getting Accuracy996196
+Node: Try To Round998906
+Node: Setting precision999805
+Ref: table-predefined-precision-strings1000502
+Node: Setting the rounding mode1002332
+Ref: table-gawk-rounding-modes1002706
+Ref: Setting the rounding mode-Footnote-11006637
+Node: Arbitrary Precision Integers1006816
+Ref: Arbitrary Precision Integers-Footnote-11009991
+Node: Checking for MPFR1010140
+Node: POSIX Floating Point Problems1011614
+Ref: POSIX Floating Point Problems-Footnote-11015899
+Node: Floating point summary1015937
+Node: Dynamic Extensions1018127
+Node: Extension Intro1019680
+Node: Plugin License1020946
+Node: Extension Mechanism Outline1021743
+Ref: figure-load-extension1022182
+Ref: figure-register-new-function1023747
+Ref: figure-call-new-function1024839
+Node: Extension API Description1026901
+Node: Extension API Functions Introduction1028614
+Ref: table-api-std-headers1030450
+Node: General Data Types1034699
+Ref: General Data Types-Footnote-11043405
+Node: Memory Allocation Functions1043704
+Ref: Memory Allocation Functions-Footnote-11048205
+Node: Constructor Functions1048304
+Node: API Ownership of MPFR and GMP Values1051957
+Node: Registration Functions1053270
+Node: Extension Functions1053970
+Node: Exit Callback Functions1059292
+Node: Extension Version String1060542
+Node: Input Parsers1061205
+Node: Output Wrappers1073926
+Node: Two-way processors1078438
+Node: Printing Messages1080703
+Ref: Printing Messages-Footnote-11081874
+Node: Updating ERRNO1082027
+Node: Requesting Values1082766
+Ref: table-value-types-returned1083503
+Node: Accessing Parameters1084611
+Node: Symbol Table Access1085848
+Node: Symbol table by name1086360
+Ref: Symbol table by name-Footnote-11089384
+Node: Symbol table by cookie1089512
+Ref: Symbol table by cookie-Footnote-11093697
+Node: Cached values1093761
+Ref: Cached values-Footnote-11097297
+Node: Array Manipulation1097450
+Ref: Array Manipulation-Footnote-11098541
+Node: Array Data Types1098578
+Ref: Array Data Types-Footnote-11101236
+Node: Array Functions1101328
+Node: Flattening Arrays1105826
+Node: Creating Arrays1112802
+Node: Redirection API1117569
+Node: Extension API Variables1120402
+Node: Extension Versioning1121113
+Ref: gawk-api-version1121542
+Node: Extension GMP/MPFR Versioning1123273
+Node: Extension API Informational Variables1124901
+Node: Extension API Boilerplate1125974
+Node: Changes from API V11129948
+Node: Finding Extensions1131520
+Node: Extension Example1132079
+Node: Internal File Description1132877
+Node: Internal File Ops1136957
+Ref: Internal File Ops-Footnote-11148307
+Node: Using Internal File Ops1148447
+Ref: Using Internal File Ops-Footnote-11150830
+Node: Extension Samples1151104
+Node: Extension Sample File Functions1152633
+Node: Extension Sample Fnmatch1160282
+Node: Extension Sample Fork1161769
+Node: Extension Sample Inplace1162987
+Node: Extension Sample Ord1166613
+Node: Extension Sample Readdir1167449
+Ref: table-readdir-file-types1168338
+Node: Extension Sample Revout1169405
+Node: Extension Sample Rev2way1169994
+Node: Extension Sample Read write array1170734
+Node: Extension Sample Readfile1172676
+Node: Extension Sample Time1173771
+Node: Extension Sample API Tests1175523
+Node: gawkextlib1176015
+Node: Extension summary1178933
+Node: Extension Exercises1182635
+Node: Language History1183877
+Node: V7/SVR3.11185533
+Node: SVR41187685
+Node: POSIX1189119
+Node: BTL1190500
+Node: POSIX/GNU1191229
+Node: Feature History1197007
+Node: Common Extensions1213326
+Node: Ranges and Locales1214609
+Ref: Ranges and Locales-Footnote-11219225
+Ref: Ranges and Locales-Footnote-21219252
+Ref: Ranges and Locales-Footnote-31219487
+Node: Contributors1219710
+Node: History summary1225707
+Node: Installation1227087
+Node: Gawk Distribution1228031
+Node: Getting1228515
+Node: Extracting1229478
+Node: Distribution contents1231116
+Node: Unix Installation1237596
+Node: Quick Installation1238278
+Node: Shell Startup Files1240692
+Node: Additional Configuration Options1241781
+Node: Configuration Philosophy1244096
+Node: Non-Unix Installation1246465
+Node: PC Installation1246925
+Node: PC Binary Installation1247763
+Node: PC Compiling1248198
+Node: PC Using1249315
+Node: Cygwin1252868
+Node: MSYS1254092
+Node: VMS Installation1254694
+Node: VMS Compilation1255485
+Ref: VMS Compilation-Footnote-11256714
+Node: VMS Dynamic Extensions1256772
+Node: VMS Installation Details1258457
+Node: VMS Running1260710
+Node: VMS GNV1264989
+Node: VMS Old Gawk1265724
+Node: Bugs1266195
+Node: Bug address1266858
+Node: Usenet1269840
+Node: Maintainers1270844
+Node: Other Versions1272029
+Node: Installation summary1279894
+Node: Notes1281103
+Node: Compatibility Mode1281897
+Node: Additions1282679
+Node: Accessing The Source1283604
+Node: Adding Code1285041
+Node: New Ports1291260
+Node: Derived Files1295635
+Ref: Derived Files-Footnote-11301295
+Ref: Derived Files-Footnote-21301330
+Ref: Derived Files-Footnote-31301928
+Node: Future Extensions1302042
+Node: Implementation Limitations1302700
+Node: Extension Design1303910
+Node: Old Extension Problems1305054
+Ref: Old Extension Problems-Footnote-11306572
+Node: Extension New Mechanism Goals1306629
+Ref: Extension New Mechanism Goals-Footnote-11309993
+Node: Extension Other Design Decisions1310182
+Node: Extension Future Growth1312295
+Node: Notes summary1312901
+Node: Basic Concepts1314059
+Node: Basic High Level1314740
+Ref: figure-general-flow1315022
+Ref: figure-process-flow1315707
+Ref: Basic High Level-Footnote-11319008
+Node: Basic Data Typing1319193
+Node: Glossary1322521
+Node: Copying1354406
+Node: GNU Free Documentation License1391949
+Node: Index1417069
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 6a7feaa..888973e 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -17515,7 +17515,8 @@ Any index with a non-numeric value will end up
positioned as if it were zero.
Order by element values in ascending order (rather than by indices).
Ordering is by the type assigned to the element
(@pxref{Typing and Comparison}).
-All numeric values come before all string values,
+All Boolean values come before all numeric values (@pxref{Boolean Typed
Values}),
+and all numeric values come before all string values,
which in turn come before all subarrays.
(Subarrays have not been described yet;
@pxref{Arrays of Arrays}.)
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index ae46956..b1eca3b 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -16656,7 +16656,8 @@ Any index with a non-numeric value will end up
positioned as if it were zero.
Order by element values in ascending order (rather than by indices).
Ordering is by the type assigned to the element
(@pxref{Typing and Comparison}).
-All numeric values come before all string values,
+All Boolean values come before all numeric values (@pxref{Boolean Typed
Values}),
+and all numeric values come before all string values,
which in turn come before all subarrays.
(Subarrays have not been described yet;
@pxref{Arrays of Arrays}.)
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0802d97db48425045eac9f2dd7748c3ee3802b65
commit 0802d97db48425045eac9f2dd7748c3ee3802b65
Merge: 1453c73 d8f4cea
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Apr 6 22:43:44 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1453c73c5c71d92aad0e2412f8098cf667ff4200
commit 1453c73c5c71d92aad0e2412f8098cf667ff4200
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Apr 6 15:25:28 2021 +0300
Update man page for bool.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index d73a864..9cf4aa3 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,6 +1,7 @@
2021-04-06 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Finish documenting bool features.
+ * gawk.1: Add minimal documentation on bool.
2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/doc/gawk.1 b/doc/gawk.1
index a8cf39f..86ddd7c 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Aug 31 2020" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 6 2021" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -3480,6 +3480,16 @@ in \*(EP.
You must also supply a text domain. Use
.B TEXTDOMAIN
if you want to use the current domain.
+.SS Boolean Valued Functions
+You can create special Boolean-typed values; see the manual for how
+they work and why they exist.
+.TP
+.BI bool( expression\^ )
+Based on the boolean value of
+.I expression
+return either a true value or a false value.
+True values have numeric value one and string value \fB"TRUE"\fR.
+False values have numeric value zero and string value \fB"False"\fR.
.SH USER-DEFINED FUNCTIONS
Functions in \*(AK are defined as follows:
.PP
@@ -3700,7 +3710,7 @@ accommodate applications that depended upon the old
behavior.
(This feature was agreed upon by both the Bell Laboratories developers
and the \*(GN developers.)
.PP
-When processing arguments,
+When procesiing arguments,
.I gawk
uses the special option \*(lq\-\^\-\*(rq to signal the end of
arguments.
@@ -4265,7 +4275,7 @@ We thank him.
.SH COPYING PERMISSIONS
Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
-2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020,
+2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021,
Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4ee6a6599fede9edeab525813d834a5f9d241391
commit 4ee6a6599fede9edeab525813d834a5f9d241391
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Apr 6 15:16:47 2021 +0300
Finish documenting bool in the manual.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 4659f15..d73a864 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Finish documenting bool features.
+
2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Start documenting bool features.
diff --git a/doc/gawk.info b/doc/gawk.info
index 9f3abe0..008160c 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12847,12 +12847,15 @@ File: gawk.info, Node: Boolean Functions, Next:
Numeric Functions, Prev: Call
9.1.2 Generating Boolean Values
-------------------------------
-This functions is specific to 'gawk'. It is not available in
+This function is specific to 'gawk'. It is not available in
compatibility mode (*note Options::):
'bool(EXPRESSION)'
-
- blah blah
+ Return a Boolean-typed value based on the regular Boolean value of
+ EXPRESSION. Boolean "true" values have numeric value one and
+ string value '"TRUE"'. Boolean "false" values have numeric zero
+ and string value '"FALSE"'. This is discussed in more detail in
+ *note Boolean Typed Values::.
File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev:
Boolean Functions, Up: Built-in
@@ -14428,6 +14431,9 @@ contexts.
'"array"'
X is an array.
+ '"bool"'
+ X is a Boolean typed value (*note Boolean Typed Values::).
+
'"regexp"'
X is a strongly typed regexp (*note Strong Regexp
Constants::).
@@ -20948,19 +20954,18 @@ File: gawk.info, Node: Boolean Typed Values, Next:
Array Sorting, Prev: Nonde
12.2 Boolean Typed Values
=========================
-This minor node describes an advanced, 'gawk'-specific extension.
-
- Scalar values in 'awk' are either numbers or strings. 'gawk' also
-supports values of type 'regexp' (FIXME pxref).
+Scalar values in 'awk' are either numbers or strings. 'gawk' also
+supports values of type 'regexp' (*note Strong Regexp Constants::).
- As seen in FIXME @ref{} here, Boolean values in 'awk' don't have a
-separate type: a value counts as "true" if it is nonzero or non-null,
-and as "false" otherwise.
+ As described in *note Truth Values::, Boolean values in 'awk' don't
+have a separate type: a value counts as "true" if it is nonzero or
+non-null, and as "false" otherwise.
When interchanging data with languages that do have a real Boolean
type, using a standard format such as JSON or XML, the lack of a true
-Boolean type in 'awk' is problematic. (FIXME: xref to gawkextlib json
-extension)
+Boolean type in 'awk' is problematic. (See, for example, the 'json'
+extension provided by the 'gawkextlib' project
+(https://sourceforge.net/projects/gawkextlib).)
It's easy to import Boolean data into 'awk', but then the fact that
it was originally Boolean is lost. Exporting data is even harder;
@@ -20972,14 +20977,20 @@ value of Boolean type.
The returned values are different than normal 'awk' values. When
treated as numbers, they are either one or zero, depending upon the
-truth value of the expression passed in the call. When treated as
-strings, they are either '"TRUE"' or '"FALSE"', again depending upon the
-truth value of the expression passed in the call. The value for "false"
-is thus unusual; it is zero numerically, but not empty when treated as a
-string.
+truth value of the original expression passed in the call to 'bool()'.
+When treated as strings, they are either '"TRUE"' or '"FALSE"', again
+depending upon the truth value of the expression passed in the call to
+'bool()'. The value for "false" is thus unusual; it is zero
+numerically, but not empty when treated as a string.
+
+ The 'typeof()' function (*note Type Functions::) returns '"bool"' for
+these values.
- The 'typeof()' function (FIXME pxref here) returns '"bool"' for these
-values.
+ While it would have been possible to add two new built-in variables
+of Boolean type named 'TRUE' and 'FALSE', doing so would undoubtedly
+have broken many existing 'awk' programs. Instead, having a "generator"
+function that creates Boolean values gives flexibility, without breaking
+any existing code.
File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Boolean
Typed Values, Up: Advanced Features
@@ -38426,364 +38437,364 @@ Node: Functions540711
Node: Built-in541749
Node: Calling Built-in542902
Node: Boolean Functions544898
-Node: Numeric Functions545211
-Ref: Numeric Functions-Footnote-1549238
-Ref: Numeric Functions-Footnote-2549886
-Ref: Numeric Functions-Footnote-3549934
-Node: String Functions550206
-Ref: String Functions-Footnote-1574347
-Ref: String Functions-Footnote-2574475
-Ref: String Functions-Footnote-3574723
-Node: Gory Details574810
-Ref: table-sub-escapes576601
-Ref: table-sub-proposed578120
-Ref: table-posix-sub579483
-Ref: table-gensub-escapes581024
-Ref: Gory Details-Footnote-1581847
-Node: I/O Functions582001
-Ref: table-system-return-values588455
-Ref: I/O Functions-Footnote-1590535
-Ref: I/O Functions-Footnote-2590683
-Node: Time Functions590803
-Ref: Time Functions-Footnote-1601474
-Ref: Time Functions-Footnote-2601542
-Ref: Time Functions-Footnote-3601700
-Ref: Time Functions-Footnote-4601811
-Ref: Time Functions-Footnote-5601923
-Ref: Time Functions-Footnote-6602150
-Node: Bitwise Functions602416
-Ref: table-bitwise-ops603010
-Ref: Bitwise Functions-Footnote-1609073
-Ref: Bitwise Functions-Footnote-2609246
-Node: Type Functions609437
-Node: I18N Functions612300
-Node: User-defined613951
-Node: Definition Syntax614763
-Ref: Definition Syntax-Footnote-1620457
-Node: Function Example620528
-Ref: Function Example-Footnote-1623450
-Node: Function Calling623472
-Node: Calling A Function624060
-Node: Variable Scope625018
-Node: Pass By Value/Reference628012
-Node: Function Caveats630656
-Ref: Function Caveats-Footnote-1632703
-Node: Return Statement632823
-Node: Dynamic Typing635802
-Node: Indirect Calls636732
-Ref: Indirect Calls-Footnote-1646987
-Node: Functions Summary647115
-Node: Library Functions649820
-Ref: Library Functions-Footnote-1653427
-Ref: Library Functions-Footnote-2653570
-Node: Library Names653741
-Ref: Library Names-Footnote-1657408
-Ref: Library Names-Footnote-2657631
-Node: General Functions657717
-Node: Strtonum Function658820
-Node: Assert Function661842
-Node: Round Function665168
-Node: Cliff Random Function666708
-Node: Ordinal Functions667724
-Ref: Ordinal Functions-Footnote-1670787
-Ref: Ordinal Functions-Footnote-2671039
-Node: Join Function671249
-Ref: Join Function-Footnote-1673019
-Node: Getlocaltime Function673219
-Node: Readfile Function676961
-Node: Shell Quoting678938
-Node: Data File Management680339
-Node: Filetrans Function680971
-Node: Rewind Function685067
-Node: File Checking686976
-Ref: File Checking-Footnote-1688310
-Node: Empty Files688511
-Node: Ignoring Assigns690490
-Node: Getopt Function692040
-Ref: Getopt Function-Footnote-1707251
-Node: Passwd Functions707451
-Ref: Passwd Functions-Footnote-1716290
-Node: Group Functions716378
-Ref: Group Functions-Footnote-1724276
-Node: Walking Arrays724483
-Node: Library Functions Summary727491
-Node: Library Exercises728897
-Node: Sample Programs729362
-Node: Running Examples730132
-Node: Clones730860
-Node: Cut Program732084
-Node: Egrep Program742224
-Node: Id Program751225
-Node: Split Program761172
-Ref: Split Program-Footnote-1771062
-Node: Tee Program771235
-Node: Uniq Program774025
-Node: Wc Program781613
-Node: Bytes vs. Characters782000
-Node: Using extensions783548
-Node: wc program784302
-Node: Miscellaneous Programs789167
-Node: Dupword Program790380
-Node: Alarm Program792410
-Node: Translate Program797265
-Ref: Translate Program-Footnote-1801830
-Node: Labels Program802100
-Ref: Labels Program-Footnote-1805451
-Node: Word Sorting805535
-Node: History Sorting809607
-Node: Extract Program811832
-Node: Simple Sed819886
-Node: Igawk Program822960
-Ref: Igawk Program-Footnote-1837291
-Ref: Igawk Program-Footnote-2837493
-Ref: Igawk Program-Footnote-3837615
-Node: Anagram Program837730
-Node: Signature Program840792
-Node: Programs Summary842039
-Node: Programs Exercises843253
-Ref: Programs Exercises-Footnote-1847383
-Node: Advanced Features847469
-Node: Nondecimal Data849593
-Node: Boolean Typed Values851191
-Node: Array Sorting852815
-Node: Controlling Array Traversal853520
-Ref: Controlling Array Traversal-Footnote-1861888
-Node: Array Sorting Functions862006
-Ref: Array Sorting Functions-Footnote-1867097
-Node: Two-way I/O867293
-Ref: Two-way I/O-Footnote-1875014
-Ref: Two-way I/O-Footnote-2875201
-Node: TCP/IP Networking875283
-Node: Profiling878401
-Node: Extension Philosophy887710
-Node: Advanced Features Summary889189
-Node: Internationalization891204
-Node: I18N and L10N892684
-Node: Explaining gettext893371
-Ref: Explaining gettext-Footnote-1899263
-Ref: Explaining gettext-Footnote-2899448
-Node: Programmer i18n899613
-Ref: Programmer i18n-Footnote-1904562
-Node: Translator i18n904611
-Node: String Extraction905405
-Ref: String Extraction-Footnote-1906537
-Node: Printf Ordering906623
-Ref: Printf Ordering-Footnote-1909409
-Node: I18N Portability909473
-Ref: I18N Portability-Footnote-1911929
-Node: I18N Example911992
-Ref: I18N Example-Footnote-1915267
-Ref: I18N Example-Footnote-2915340
-Node: Gawk I18N915449
-Node: I18N Summary916098
-Node: Debugger917439
-Node: Debugging918439
-Node: Debugging Concepts918880
-Node: Debugging Terms920689
-Node: Awk Debugging923264
-Ref: Awk Debugging-Footnote-1924209
-Node: Sample Debugging Session924341
-Node: Debugger Invocation924875
-Node: Finding The Bug926261
-Node: List of Debugger Commands932735
-Node: Breakpoint Control934068
-Node: Debugger Execution Control937762
-Node: Viewing And Changing Data941124
-Node: Execution Stack944665
-Node: Debugger Info946302
-Node: Miscellaneous Debugger Commands950373
-Node: Readline Support955435
-Node: Limitations956331
-Node: Debugging Summary958885
-Node: Namespaces960164
-Node: Global Namespace961275
-Node: Qualified Names962673
-Node: Default Namespace963672
-Node: Changing The Namespace964413
-Node: Naming Rules966027
-Node: Internal Name Management967875
-Node: Namespace Example968917
-Node: Namespace And Features971479
-Node: Namespace Summary972914
-Node: Arbitrary Precision Arithmetic974391
-Node: Computer Arithmetic975878
-Ref: table-numeric-ranges979644
-Ref: table-floating-point-ranges980137
-Ref: Computer Arithmetic-Footnote-1980795
-Node: Math Definitions980852
-Ref: table-ieee-formats983828
-Node: MPFR features984395
-Node: FP Math Caution986113
-Ref: FP Math Caution-Footnote-1987185
-Node: Inexactness of computations987554
-Node: Inexact representation988585
-Node: Comparing FP Values989945
-Node: Errors accumulate991186
-Node: Strange values992642
-Ref: Strange values-Footnote-1995230
-Node: Getting Accuracy995335
-Node: Try To Round998045
-Node: Setting precision998944
-Ref: table-predefined-precision-strings999641
-Node: Setting the rounding mode1001471
-Ref: table-gawk-rounding-modes1001845
-Ref: Setting the rounding mode-Footnote-11005776
-Node: Arbitrary Precision Integers1005955
-Ref: Arbitrary Precision Integers-Footnote-11009130
-Node: Checking for MPFR1009279
-Node: POSIX Floating Point Problems1010753
-Ref: POSIX Floating Point Problems-Footnote-11015038
-Node: Floating point summary1015076
-Node: Dynamic Extensions1017266
-Node: Extension Intro1018819
-Node: Plugin License1020085
-Node: Extension Mechanism Outline1020882
-Ref: figure-load-extension1021321
-Ref: figure-register-new-function1022886
-Ref: figure-call-new-function1023978
-Node: Extension API Description1026040
-Node: Extension API Functions Introduction1027753
-Ref: table-api-std-headers1029589
-Node: General Data Types1033838
-Ref: General Data Types-Footnote-11042544
-Node: Memory Allocation Functions1042843
-Ref: Memory Allocation Functions-Footnote-11047344
-Node: Constructor Functions1047443
-Node: API Ownership of MPFR and GMP Values1051096
-Node: Registration Functions1052409
-Node: Extension Functions1053109
-Node: Exit Callback Functions1058431
-Node: Extension Version String1059681
-Node: Input Parsers1060344
-Node: Output Wrappers1073065
-Node: Two-way processors1077577
-Node: Printing Messages1079842
-Ref: Printing Messages-Footnote-11081013
-Node: Updating ERRNO1081166
-Node: Requesting Values1081905
-Ref: table-value-types-returned1082642
-Node: Accessing Parameters1083750
-Node: Symbol Table Access1084987
-Node: Symbol table by name1085499
-Ref: Symbol table by name-Footnote-11088523
-Node: Symbol table by cookie1088651
-Ref: Symbol table by cookie-Footnote-11092836
-Node: Cached values1092900
-Ref: Cached values-Footnote-11096436
-Node: Array Manipulation1096589
-Ref: Array Manipulation-Footnote-11097680
-Node: Array Data Types1097717
-Ref: Array Data Types-Footnote-11100375
-Node: Array Functions1100467
-Node: Flattening Arrays1104965
-Node: Creating Arrays1111941
-Node: Redirection API1116708
-Node: Extension API Variables1119541
-Node: Extension Versioning1120252
-Ref: gawk-api-version1120681
-Node: Extension GMP/MPFR Versioning1122412
-Node: Extension API Informational Variables1124040
-Node: Extension API Boilerplate1125113
-Node: Changes from API V11129087
-Node: Finding Extensions1130659
-Node: Extension Example1131218
-Node: Internal File Description1132016
-Node: Internal File Ops1136096
-Ref: Internal File Ops-Footnote-11147446
-Node: Using Internal File Ops1147586
-Ref: Using Internal File Ops-Footnote-11149969
-Node: Extension Samples1150243
-Node: Extension Sample File Functions1151772
-Node: Extension Sample Fnmatch1159421
-Node: Extension Sample Fork1160908
-Node: Extension Sample Inplace1162126
-Node: Extension Sample Ord1165752
-Node: Extension Sample Readdir1166588
-Ref: table-readdir-file-types1167477
-Node: Extension Sample Revout1168544
-Node: Extension Sample Rev2way1169133
-Node: Extension Sample Read write array1169873
-Node: Extension Sample Readfile1171815
-Node: Extension Sample Time1172910
-Node: Extension Sample API Tests1174662
-Node: gawkextlib1175154
-Node: Extension summary1178072
-Node: Extension Exercises1181774
-Node: Language History1183016
-Node: V7/SVR3.11184672
-Node: SVR41186824
-Node: POSIX1188258
-Node: BTL1189639
-Node: POSIX/GNU1190368
-Node: Feature History1196146
-Node: Common Extensions1212465
-Node: Ranges and Locales1213748
-Ref: Ranges and Locales-Footnote-11218364
-Ref: Ranges and Locales-Footnote-21218391
-Ref: Ranges and Locales-Footnote-31218626
-Node: Contributors1218849
-Node: History summary1224846
-Node: Installation1226226
-Node: Gawk Distribution1227170
-Node: Getting1227654
-Node: Extracting1228617
-Node: Distribution contents1230255
-Node: Unix Installation1236735
-Node: Quick Installation1237417
-Node: Shell Startup Files1239831
-Node: Additional Configuration Options1240920
-Node: Configuration Philosophy1243235
-Node: Non-Unix Installation1245604
-Node: PC Installation1246064
-Node: PC Binary Installation1246902
-Node: PC Compiling1247337
-Node: PC Using1248454
-Node: Cygwin1252007
-Node: MSYS1253231
-Node: VMS Installation1253833
-Node: VMS Compilation1254624
-Ref: VMS Compilation-Footnote-11255853
-Node: VMS Dynamic Extensions1255911
-Node: VMS Installation Details1257596
-Node: VMS Running1259849
-Node: VMS GNV1264128
-Node: VMS Old Gawk1264863
-Node: Bugs1265334
-Node: Bug address1265997
-Node: Usenet1268979
-Node: Maintainers1269983
-Node: Other Versions1271168
-Node: Installation summary1279033
-Node: Notes1280242
-Node: Compatibility Mode1281036
-Node: Additions1281818
-Node: Accessing The Source1282743
-Node: Adding Code1284180
-Node: New Ports1290399
-Node: Derived Files1294774
-Ref: Derived Files-Footnote-11300434
-Ref: Derived Files-Footnote-21300469
-Ref: Derived Files-Footnote-31301067
-Node: Future Extensions1301181
-Node: Implementation Limitations1301839
-Node: Extension Design1303049
-Node: Old Extension Problems1304193
-Ref: Old Extension Problems-Footnote-11305711
-Node: Extension New Mechanism Goals1305768
-Ref: Extension New Mechanism Goals-Footnote-11309132
-Node: Extension Other Design Decisions1309321
-Node: Extension Future Growth1311434
-Node: Notes summary1312040
-Node: Basic Concepts1313198
-Node: Basic High Level1313879
-Ref: figure-general-flow1314161
-Ref: figure-process-flow1314846
-Ref: Basic High Level-Footnote-11318147
-Node: Basic Data Typing1318332
-Node: Glossary1321660
-Node: Copying1353545
-Node: GNU Free Documentation License1391088
-Node: Index1416208
+Node: Numeric Functions545508
+Ref: Numeric Functions-Footnote-1549535
+Ref: Numeric Functions-Footnote-2550183
+Ref: Numeric Functions-Footnote-3550231
+Node: String Functions550503
+Ref: String Functions-Footnote-1574644
+Ref: String Functions-Footnote-2574772
+Ref: String Functions-Footnote-3575020
+Node: Gory Details575107
+Ref: table-sub-escapes576898
+Ref: table-sub-proposed578417
+Ref: table-posix-sub579780
+Ref: table-gensub-escapes581321
+Ref: Gory Details-Footnote-1582144
+Node: I/O Functions582298
+Ref: table-system-return-values588752
+Ref: I/O Functions-Footnote-1590832
+Ref: I/O Functions-Footnote-2590980
+Node: Time Functions591100
+Ref: Time Functions-Footnote-1601771
+Ref: Time Functions-Footnote-2601839
+Ref: Time Functions-Footnote-3601997
+Ref: Time Functions-Footnote-4602108
+Ref: Time Functions-Footnote-5602220
+Ref: Time Functions-Footnote-6602447
+Node: Bitwise Functions602713
+Ref: table-bitwise-ops603307
+Ref: Bitwise Functions-Footnote-1609370
+Ref: Bitwise Functions-Footnote-2609543
+Node: Type Functions609734
+Node: I18N Functions612681
+Node: User-defined614332
+Node: Definition Syntax615144
+Ref: Definition Syntax-Footnote-1620838
+Node: Function Example620909
+Ref: Function Example-Footnote-1623831
+Node: Function Calling623853
+Node: Calling A Function624441
+Node: Variable Scope625399
+Node: Pass By Value/Reference628393
+Node: Function Caveats631037
+Ref: Function Caveats-Footnote-1633084
+Node: Return Statement633204
+Node: Dynamic Typing636183
+Node: Indirect Calls637113
+Ref: Indirect Calls-Footnote-1647368
+Node: Functions Summary647496
+Node: Library Functions650201
+Ref: Library Functions-Footnote-1653808
+Ref: Library Functions-Footnote-2653951
+Node: Library Names654122
+Ref: Library Names-Footnote-1657789
+Ref: Library Names-Footnote-2658012
+Node: General Functions658098
+Node: Strtonum Function659201
+Node: Assert Function662223
+Node: Round Function665549
+Node: Cliff Random Function667089
+Node: Ordinal Functions668105
+Ref: Ordinal Functions-Footnote-1671168
+Ref: Ordinal Functions-Footnote-2671420
+Node: Join Function671630
+Ref: Join Function-Footnote-1673400
+Node: Getlocaltime Function673600
+Node: Readfile Function677342
+Node: Shell Quoting679319
+Node: Data File Management680720
+Node: Filetrans Function681352
+Node: Rewind Function685448
+Node: File Checking687357
+Ref: File Checking-Footnote-1688691
+Node: Empty Files688892
+Node: Ignoring Assigns690871
+Node: Getopt Function692421
+Ref: Getopt Function-Footnote-1707632
+Node: Passwd Functions707832
+Ref: Passwd Functions-Footnote-1716671
+Node: Group Functions716759
+Ref: Group Functions-Footnote-1724657
+Node: Walking Arrays724864
+Node: Library Functions Summary727872
+Node: Library Exercises729278
+Node: Sample Programs729743
+Node: Running Examples730513
+Node: Clones731241
+Node: Cut Program732465
+Node: Egrep Program742605
+Node: Id Program751606
+Node: Split Program761553
+Ref: Split Program-Footnote-1771443
+Node: Tee Program771616
+Node: Uniq Program774406
+Node: Wc Program781994
+Node: Bytes vs. Characters782381
+Node: Using extensions783929
+Node: wc program784683
+Node: Miscellaneous Programs789548
+Node: Dupword Program790761
+Node: Alarm Program792791
+Node: Translate Program797646
+Ref: Translate Program-Footnote-1802211
+Node: Labels Program802481
+Ref: Labels Program-Footnote-1805832
+Node: Word Sorting805916
+Node: History Sorting809988
+Node: Extract Program812213
+Node: Simple Sed820267
+Node: Igawk Program823341
+Ref: Igawk Program-Footnote-1837672
+Ref: Igawk Program-Footnote-2837874
+Ref: Igawk Program-Footnote-3837996
+Node: Anagram Program838111
+Node: Signature Program841173
+Node: Programs Summary842420
+Node: Programs Exercises843634
+Ref: Programs Exercises-Footnote-1847764
+Node: Advanced Features847850
+Node: Nondecimal Data849974
+Node: Boolean Typed Values851572
+Node: Array Sorting853580
+Node: Controlling Array Traversal854285
+Ref: Controlling Array Traversal-Footnote-1862653
+Node: Array Sorting Functions862771
+Ref: Array Sorting Functions-Footnote-1867862
+Node: Two-way I/O868058
+Ref: Two-way I/O-Footnote-1875779
+Ref: Two-way I/O-Footnote-2875966
+Node: TCP/IP Networking876048
+Node: Profiling879166
+Node: Extension Philosophy888475
+Node: Advanced Features Summary889954
+Node: Internationalization891969
+Node: I18N and L10N893449
+Node: Explaining gettext894136
+Ref: Explaining gettext-Footnote-1900028
+Ref: Explaining gettext-Footnote-2900213
+Node: Programmer i18n900378
+Ref: Programmer i18n-Footnote-1905327
+Node: Translator i18n905376
+Node: String Extraction906170
+Ref: String Extraction-Footnote-1907302
+Node: Printf Ordering907388
+Ref: Printf Ordering-Footnote-1910174
+Node: I18N Portability910238
+Ref: I18N Portability-Footnote-1912694
+Node: I18N Example912757
+Ref: I18N Example-Footnote-1916032
+Ref: I18N Example-Footnote-2916105
+Node: Gawk I18N916214
+Node: I18N Summary916863
+Node: Debugger918204
+Node: Debugging919204
+Node: Debugging Concepts919645
+Node: Debugging Terms921454
+Node: Awk Debugging924029
+Ref: Awk Debugging-Footnote-1924974
+Node: Sample Debugging Session925106
+Node: Debugger Invocation925640
+Node: Finding The Bug927026
+Node: List of Debugger Commands933500
+Node: Breakpoint Control934833
+Node: Debugger Execution Control938527
+Node: Viewing And Changing Data941889
+Node: Execution Stack945430
+Node: Debugger Info947067
+Node: Miscellaneous Debugger Commands951138
+Node: Readline Support956200
+Node: Limitations957096
+Node: Debugging Summary959650
+Node: Namespaces960929
+Node: Global Namespace962040
+Node: Qualified Names963438
+Node: Default Namespace964437
+Node: Changing The Namespace965178
+Node: Naming Rules966792
+Node: Internal Name Management968640
+Node: Namespace Example969682
+Node: Namespace And Features972244
+Node: Namespace Summary973679
+Node: Arbitrary Precision Arithmetic975156
+Node: Computer Arithmetic976643
+Ref: table-numeric-ranges980409
+Ref: table-floating-point-ranges980902
+Ref: Computer Arithmetic-Footnote-1981560
+Node: Math Definitions981617
+Ref: table-ieee-formats984593
+Node: MPFR features985160
+Node: FP Math Caution986878
+Ref: FP Math Caution-Footnote-1987950
+Node: Inexactness of computations988319
+Node: Inexact representation989350
+Node: Comparing FP Values990710
+Node: Errors accumulate991951
+Node: Strange values993407
+Ref: Strange values-Footnote-1995995
+Node: Getting Accuracy996100
+Node: Try To Round998810
+Node: Setting precision999709
+Ref: table-predefined-precision-strings1000406
+Node: Setting the rounding mode1002236
+Ref: table-gawk-rounding-modes1002610
+Ref: Setting the rounding mode-Footnote-11006541
+Node: Arbitrary Precision Integers1006720
+Ref: Arbitrary Precision Integers-Footnote-11009895
+Node: Checking for MPFR1010044
+Node: POSIX Floating Point Problems1011518
+Ref: POSIX Floating Point Problems-Footnote-11015803
+Node: Floating point summary1015841
+Node: Dynamic Extensions1018031
+Node: Extension Intro1019584
+Node: Plugin License1020850
+Node: Extension Mechanism Outline1021647
+Ref: figure-load-extension1022086
+Ref: figure-register-new-function1023651
+Ref: figure-call-new-function1024743
+Node: Extension API Description1026805
+Node: Extension API Functions Introduction1028518
+Ref: table-api-std-headers1030354
+Node: General Data Types1034603
+Ref: General Data Types-Footnote-11043309
+Node: Memory Allocation Functions1043608
+Ref: Memory Allocation Functions-Footnote-11048109
+Node: Constructor Functions1048208
+Node: API Ownership of MPFR and GMP Values1051861
+Node: Registration Functions1053174
+Node: Extension Functions1053874
+Node: Exit Callback Functions1059196
+Node: Extension Version String1060446
+Node: Input Parsers1061109
+Node: Output Wrappers1073830
+Node: Two-way processors1078342
+Node: Printing Messages1080607
+Ref: Printing Messages-Footnote-11081778
+Node: Updating ERRNO1081931
+Node: Requesting Values1082670
+Ref: table-value-types-returned1083407
+Node: Accessing Parameters1084515
+Node: Symbol Table Access1085752
+Node: Symbol table by name1086264
+Ref: Symbol table by name-Footnote-11089288
+Node: Symbol table by cookie1089416
+Ref: Symbol table by cookie-Footnote-11093601
+Node: Cached values1093665
+Ref: Cached values-Footnote-11097201
+Node: Array Manipulation1097354
+Ref: Array Manipulation-Footnote-11098445
+Node: Array Data Types1098482
+Ref: Array Data Types-Footnote-11101140
+Node: Array Functions1101232
+Node: Flattening Arrays1105730
+Node: Creating Arrays1112706
+Node: Redirection API1117473
+Node: Extension API Variables1120306
+Node: Extension Versioning1121017
+Ref: gawk-api-version1121446
+Node: Extension GMP/MPFR Versioning1123177
+Node: Extension API Informational Variables1124805
+Node: Extension API Boilerplate1125878
+Node: Changes from API V11129852
+Node: Finding Extensions1131424
+Node: Extension Example1131983
+Node: Internal File Description1132781
+Node: Internal File Ops1136861
+Ref: Internal File Ops-Footnote-11148211
+Node: Using Internal File Ops1148351
+Ref: Using Internal File Ops-Footnote-11150734
+Node: Extension Samples1151008
+Node: Extension Sample File Functions1152537
+Node: Extension Sample Fnmatch1160186
+Node: Extension Sample Fork1161673
+Node: Extension Sample Inplace1162891
+Node: Extension Sample Ord1166517
+Node: Extension Sample Readdir1167353
+Ref: table-readdir-file-types1168242
+Node: Extension Sample Revout1169309
+Node: Extension Sample Rev2way1169898
+Node: Extension Sample Read write array1170638
+Node: Extension Sample Readfile1172580
+Node: Extension Sample Time1173675
+Node: Extension Sample API Tests1175427
+Node: gawkextlib1175919
+Node: Extension summary1178837
+Node: Extension Exercises1182539
+Node: Language History1183781
+Node: V7/SVR3.11185437
+Node: SVR41187589
+Node: POSIX1189023
+Node: BTL1190404
+Node: POSIX/GNU1191133
+Node: Feature History1196911
+Node: Common Extensions1213230
+Node: Ranges and Locales1214513
+Ref: Ranges and Locales-Footnote-11219129
+Ref: Ranges and Locales-Footnote-21219156
+Ref: Ranges and Locales-Footnote-31219391
+Node: Contributors1219614
+Node: History summary1225611
+Node: Installation1226991
+Node: Gawk Distribution1227935
+Node: Getting1228419
+Node: Extracting1229382
+Node: Distribution contents1231020
+Node: Unix Installation1237500
+Node: Quick Installation1238182
+Node: Shell Startup Files1240596
+Node: Additional Configuration Options1241685
+Node: Configuration Philosophy1244000
+Node: Non-Unix Installation1246369
+Node: PC Installation1246829
+Node: PC Binary Installation1247667
+Node: PC Compiling1248102
+Node: PC Using1249219
+Node: Cygwin1252772
+Node: MSYS1253996
+Node: VMS Installation1254598
+Node: VMS Compilation1255389
+Ref: VMS Compilation-Footnote-11256618
+Node: VMS Dynamic Extensions1256676
+Node: VMS Installation Details1258361
+Node: VMS Running1260614
+Node: VMS GNV1264893
+Node: VMS Old Gawk1265628
+Node: Bugs1266099
+Node: Bug address1266762
+Node: Usenet1269744
+Node: Maintainers1270748
+Node: Other Versions1271933
+Node: Installation summary1279798
+Node: Notes1281007
+Node: Compatibility Mode1281801
+Node: Additions1282583
+Node: Accessing The Source1283508
+Node: Adding Code1284945
+Node: New Ports1291164
+Node: Derived Files1295539
+Ref: Derived Files-Footnote-11301199
+Ref: Derived Files-Footnote-21301234
+Ref: Derived Files-Footnote-31301832
+Node: Future Extensions1301946
+Node: Implementation Limitations1302604
+Node: Extension Design1303814
+Node: Old Extension Problems1304958
+Ref: Old Extension Problems-Footnote-11306476
+Node: Extension New Mechanism Goals1306533
+Ref: Extension New Mechanism Goals-Footnote-11309897
+Node: Extension Other Design Decisions1310086
+Node: Extension Future Growth1312199
+Node: Notes summary1312805
+Node: Basic Concepts1313963
+Node: Basic High Level1314644
+Ref: figure-general-flow1314926
+Ref: figure-process-flow1315611
+Ref: Basic High Level-Footnote-11318912
+Node: Basic Data Typing1319097
+Node: Glossary1322425
+Node: Copying1354310
+Node: GNU Free Documentation License1391853
+Node: Index1416973
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 280b316..6a7feaa 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18385,15 +18385,18 @@ two arguments 11 and 10.
@subsection Generating Boolean Values
@cindex boolean function
-This functions is specific to @command{gawk}. It is not
+This function is specific to @command{gawk}. It is not
available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
@item @code{bool(@var{expression})}
@cindexgawkfunc{bool}
-
-blah blah
+Return a Boolean-typed value based on the regular Boolean value
+of @var{expression}. Boolean ``true'' values have numeric value one
+and string value @code{"TRUE"}. Boolean ``false'' values have numeric
+zero and string value @code{"FALSE"}. This is discussed in more
+detail in @ref{Boolean Typed Values}.
@end table
@node Numeric Functions
@@ -20912,6 +20915,9 @@ Return one of the following strings, depending upon the
type of @var{x}:
@item "array"
@var{x} is an array.
+@item "bool"
+@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
+
@item "regexp"
@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}).
@@ -29475,19 +29481,19 @@ This option may disappear in a future version of
@command{gawk}.
@node Boolean Typed Values
@section Boolean Typed Values
-This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
-
Scalar values in @command{awk} are either numbers or strings.
-@command{gawk} also supports values of type @code{regexp} (FIXME pxref).
+@command{gawk} also supports values of type @code{regexp}
+(@pxref{Strong Regexp Constants}).
-As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a
separate
-type: a value counts as ``true'' if it is nonzero or non-null, and as
-``false'' otherwise.
+As described in @ref{Truth Values}, Boolean values in @command{awk}
+don't have a separate type: a value counts as ``true'' if it is nonzero
+or non-null, and as ``false'' otherwise.
When interchanging data with languages that do have a real Boolean type,
using a standard format such as JSON or XML, the lack of a true Boolean
-type in @command{awk} is problematic. (FIXME: xref to gawkextlib json
-extension)
+type in @command{awk} is problematic.
+(See, for example, the @code{json} extension provided by
+@uref{https://sourceforge.net/projects/gawkextlib, the @code{gawkextlib}
project}.)
It's easy to import Boolean data into @command{awk}, but then the fact
that it was originally Boolean is lost. Exporting data is even harder;
@@ -29497,16 +29503,22 @@ To solve this problem, @command{gawk} provides a
function named @code{bool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-The returned values are different than
-normal @command{awk} values. When treated as numbers, they are either
-one or zero, depending upon the truth value of the expression passed
-in the call. When treated as strings, they are either @code{"TRUE"}
-or @code{"FALSE"}, again depending upon the truth value of the expression
passed
-in the call. The value for ``false'' is thus unusual; it is zero numerically,
-but not empty when treated as a string.
-
-The @code{typeof()} function (FIXME pxref here) returns @code{"bool"}
-for these values.
+The returned values are different than normal @command{awk} values. When
+treated as numbers, they are either one or zero, depending upon the truth
+value of the original expression passed in the call to @code{bool()}. When
+treated as strings, they are either @code{"TRUE"} or @code{"FALSE"},
+again depending upon the truth value of the expression passed in the
+call to @code{bool()}. The value for ``false'' is thus unusual; it is
+zero numerically, but not empty when treated as a string.
+
+The @code{typeof()} function (@pxref{Type Functions}) returns
+@code{"bool"} for these values.
+
+While it would have been possible to add two new built-in variables
+of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
+undoubtedly have broken many existing @command{awk} programs. Instead,
+having a ``generator'' function that creates Boolean values gives
+flexibility, without breaking any existing code.
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 6937cec..ae46956 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17526,15 +17526,18 @@ two arguments 11 and 10.
@subsection Generating Boolean Values
@cindex boolean function
-This functions is specific to @command{gawk}. It is not
+This function is specific to @command{gawk}. It is not
available in compatibility mode (@pxref{Options}):
@c @asis for docbook
@table @asis
@item @code{bool(@var{expression})}
@cindexgawkfunc{bool}
-
-blah blah
+Return a Boolean-typed value based on the regular Boolean value
+of @var{expression}. Boolean ``true'' values have numeric value one
+and string value @code{"TRUE"}. Boolean ``false'' values have numeric
+zero and string value @code{"FALSE"}. This is discussed in more
+detail in @ref{Boolean Typed Values}.
@end table
@node Numeric Functions
@@ -19824,6 +19827,9 @@ Return one of the following strings, depending upon the
type of @var{x}:
@item "array"
@var{x} is an array.
+@item "bool"
+@var{x} is a Boolean typed value (@pxref{Boolean Typed Values}).
+
@item "regexp"
@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}).
@@ -28357,19 +28363,19 @@ This option may disappear in a future version of
@command{gawk}.
@node Boolean Typed Values
@section Boolean Typed Values
-This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
-
Scalar values in @command{awk} are either numbers or strings.
-@command{gawk} also supports values of type @code{regexp} (FIXME pxref).
+@command{gawk} also supports values of type @code{regexp}
+(@pxref{Strong Regexp Constants}).
-As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a
separate
-type: a value counts as ``true'' if it is nonzero or non-null, and as
-``false'' otherwise.
+As described in @ref{Truth Values}, Boolean values in @command{awk}
+don't have a separate type: a value counts as ``true'' if it is nonzero
+or non-null, and as ``false'' otherwise.
When interchanging data with languages that do have a real Boolean type,
using a standard format such as JSON or XML, the lack of a true Boolean
-type in @command{awk} is problematic. (FIXME: xref to gawkextlib json
-extension)
+type in @command{awk} is problematic.
+(See, for example, the @code{json} extension provided by
+@uref{https://sourceforge.net/projects/gawkextlib, the @code{gawkextlib}
project}.)
It's easy to import Boolean data into @command{awk}, but then the fact
that it was originally Boolean is lost. Exporting data is even harder;
@@ -28379,16 +28385,22 @@ To solve this problem, @command{gawk} provides a
function named @code{bool()}.
It takes one argument, which is any @command{awk} expression, and it
returns a value of Boolean type.
-The returned values are different than
-normal @command{awk} values. When treated as numbers, they are either
-one or zero, depending upon the truth value of the expression passed
-in the call. When treated as strings, they are either @code{"TRUE"}
-or @code{"FALSE"}, again depending upon the truth value of the expression
passed
-in the call. The value for ``false'' is thus unusual; it is zero numerically,
-but not empty when treated as a string.
-
-The @code{typeof()} function (FIXME pxref here) returns @code{"bool"}
-for these values.
+The returned values are different than normal @command{awk} values. When
+treated as numbers, they are either one or zero, depending upon the truth
+value of the original expression passed in the call to @code{bool()}. When
+treated as strings, they are either @code{"TRUE"} or @code{"FALSE"},
+again depending upon the truth value of the expression passed in the
+call to @code{bool()}. The value for ``false'' is thus unusual; it is
+zero numerically, but not empty when treated as a string.
+
+The @code{typeof()} function (@pxref{Type Functions}) returns
+@code{"bool"} for these values.
+
+While it would have been possible to add two new built-in variables
+of Boolean type named @code{TRUE} and @code{FALSE}, doing so would
+undoubtedly have broken many existing @command{awk} programs. Instead,
+having a ``generator'' function that creates Boolean values gives
+flexibility, without breaking any existing code.
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1f10523de0fc469f0604f5642562f92da608311d
commit 1f10523de0fc469f0604f5642562f92da608311d
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Apr 4 22:10:26 2021 +0300
Start documenting bool stuff.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 696dafa..4659f15 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,9 @@
2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
+ * gawktexi.in: Start documenting bool features.
+
+2021-04-04 Arnold D. Robbins <arnold@skeeve.com>
+
* gawktexi.in: Update menues.
2021-03-31 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/doc/gawk.info b/doc/gawk.info
index 057f18d..9f3abe0 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -381,6 +381,8 @@ in (a) below. A copy of the license is included in the
section entitled
* Arrays Summary:: Summary of arrays.
* Built-in:: Summarizes the built-in functions.
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean
+ values.
* Numeric Functions:: Functions that work with numbers,
including 'int()', 'sin()'
and 'rand()'.
@@ -488,6 +490,7 @@ in (a) below. A copy of the license is included in the
section entitled
* Programs Summary:: Summary of programs.
* Programs Exercises:: Exercises.
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with 'bool' type.
* Array Sorting:: Facilities for controlling array
traversal and sorting arrays.
* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
@@ -12782,6 +12785,7 @@ your convenience.
* Menu:
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean values.
* Numeric Functions:: Functions that work with numbers, including
'int()', 'sin()' and 'rand()'.
* String Functions:: Functions for string manipulation, such as
@@ -12794,7 +12798,7 @@ your convenience.
* I18N Functions:: Functions for string translation.
-File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up:
Built-in
+File: gawk.info, Node: Calling Built-in, Next: Boolean Functions, Up:
Built-in
9.1.1 Calling Built-in Functions
--------------------------------
@@ -12838,9 +12842,22 @@ six, and then 12, and 'atan2()' is called with the two
arguments six and
10, then 11, and 'atan2()' is called with the two arguments 11 and 10.
-File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev:
Calling Built-in, Up: Built-in
+File: gawk.info, Node: Boolean Functions, Next: Numeric Functions, Prev:
Calling Built-in, Up: Built-in
-9.1.2 Numeric Functions
+9.1.2 Generating Boolean Values
+-------------------------------
+
+This functions is specific to 'gawk'. It is not available in
+compatibility mode (*note Options::):
+
+'bool(EXPRESSION)'
+
+ blah blah
+
+
+File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev:
Boolean Functions, Up: Built-in
+
+9.1.3 Numeric Functions
-----------------------
The following list describes all of the built-in functions that work
@@ -12964,7 +12981,7 @@ the same sequence of random numbers over and over again.
File: gawk.info, Node: String Functions, Next: I/O Functions, Prev: Numeric
Functions, Up: Built-in
-9.1.3 String-Manipulation Functions
+9.1.4 String-Manipulation Functions
-----------------------------------
The functions in this minor node look at or change the text of one or
@@ -13532,7 +13549,7 @@ number zero.
File: gawk.info, Node: Gory Details, Up: String Functions
-9.1.3.1 More about '\' and '&' with 'sub()', 'gsub()', and 'gensub()'
+9.1.4.1 More about '\' and '&' with 'sub()', 'gsub()', and 'gensub()'
.....................................................................
CAUTION: This subsubsection has been reported to cause headaches.
@@ -13678,7 +13695,7 @@ POSIX rules.
File: gawk.info, Node: I/O Functions, Next: Time Functions, Prev: String
Functions, Up: Built-in
-9.1.4 Input/Output Functions
+9.1.5 Input/Output Functions
----------------------------
The following functions relate to input/output (I/O). Optional
@@ -13895,7 +13912,7 @@ the way this was done was probably a mistake.
File: gawk.info, Node: Time Functions, Next: Bitwise Functions, Prev: I/O
Functions, Up: Built-in
-9.1.5 Time Functions
+9.1.6 Time Functions
--------------------
'awk' programs are commonly used to process log files containing
@@ -14212,7 +14229,7 @@ does not appear in the returned string or appears
literally.
File: gawk.info, Node: Bitwise Functions, Next: Type Functions, Prev: Time
Functions, Up: Built-in
-9.1.6 Bit-Manipulation Functions
+9.1.7 Bit-Manipulation Functions
--------------------------------
I can explain it for you, but I can't understand it for you.
@@ -14394,7 +14411,7 @@ that range are reduced to fit within the range.
File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise
Functions, Up: Built-in
-9.1.7 Getting Type Information
+9.1.8 Getting Type Information
------------------------------
'gawk' provides two functions that let you distinguish the type of a
@@ -14479,7 +14496,7 @@ arguments from untyped to unassigned.
File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in
-9.1.8 String-Translation Functions
+9.1.9 String-Translation Functions
----------------------------------
'gawk' provides facilities for internationalizing 'awk' programs. These
@@ -15158,7 +15175,7 @@ File: gawk.info, Node: Indirect Calls, Next:
Functions Summary, Prev: User-de
9.3 Indirect Function Calls
===========================
-This section describes an advanced, 'gawk'-specific extension.
+This minor node describes an advanced, 'gawk'-specific extension.
Often, you may wish to defer the choice of function to call until
runtime. For example, you may have different kinds of records, each of
@@ -20873,6 +20890,7 @@ their own:
* Menu:
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with 'bool' type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -20882,7 +20900,7 @@ their own:
* Advanced Features Summary:: Summary of advanced features.
-File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced
Features
+File: gawk.info, Node: Nondecimal Data, Next: Boolean Typed Values, Up:
Advanced Features
12.1 Allowing Nondecimal Input Data
===================================
@@ -20925,9 +20943,48 @@ request it.
This option may disappear in a future version of 'gawk'.
-File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal
Data, Up: Advanced Features
+File: gawk.info, Node: Boolean Typed Values, Next: Array Sorting, Prev:
Nondecimal Data, Up: Advanced Features
+
+12.2 Boolean Typed Values
+=========================
+
+This minor node describes an advanced, 'gawk'-specific extension.
+
+ Scalar values in 'awk' are either numbers or strings. 'gawk' also
+supports values of type 'regexp' (FIXME pxref).
+
+ As seen in FIXME @ref{} here, Boolean values in 'awk' don't have a
+separate type: a value counts as "true" if it is nonzero or non-null,
+and as "false" otherwise.
+
+ When interchanging data with languages that do have a real Boolean
+type, using a standard format such as JSON or XML, the lack of a true
+Boolean type in 'awk' is problematic. (FIXME: xref to gawkextlib json
+extension)
+
+ It's easy to import Boolean data into 'awk', but then the fact that
+it was originally Boolean is lost. Exporting data is even harder;
+there's no way to indicate that a value is really Boolean.
+
+ To solve this problem, 'gawk' provides a function named 'bool()'. It
+takes one argument, which is any 'awk' expression, and it returns a
+value of Boolean type.
+
+ The returned values are different than normal 'awk' values. When
+treated as numbers, they are either one or zero, depending upon the
+truth value of the expression passed in the call. When treated as
+strings, they are either '"TRUE"' or '"FALSE"', again depending upon the
+truth value of the expression passed in the call. The value for "false"
+is thus unusual; it is zero numerically, but not empty when treated as a
+string.
+
+ The 'typeof()' function (FIXME pxref here) returns '"bool"' for these
+values.
+
+
+File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Boolean
Typed Values, Up: Advanced Features
-12.2 Controlling Array Traversal and Array Sorting
+12.3 Controlling Array Traversal and Array Sorting
==================================================
'gawk' lets you control the order in which a 'for (INDX in ARRAY)' loop
@@ -20946,7 +21003,7 @@ to order the elements during sorting.
File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting
Functions, Up: Array Sorting
-12.2.1 Controlling Array Traversal
+12.3.1 Controlling Array Traversal
----------------------------------
By default, the order in which a 'for (INDX in ARRAY)' loop scans an
@@ -21185,7 +21242,7 @@ character, which cannot be part of an identifier.
File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array
Traversal, Up: Array Sorting
-12.2.2 Sorting Array Values and Indices with 'gawk'
+12.3.2 Sorting Array Values and Indices with 'gawk'
---------------------------------------------------
In most 'awk' implementations, sorting an array requires writing a
@@ -21325,7 +21382,7 @@ POSIX-compatibility mode, and because 'asort()' and
'asorti()' are
File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array
Sorting, Up: Advanced Features
-12.3 Two-Way Communications with Another Process
+12.4 Two-Way Communications with Another Process
================================================
It is often useful to be able to send data to a separate program for
@@ -21520,7 +21577,7 @@ in Bash.
File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way
I/O, Up: Advanced Features
-12.4 Using 'gawk' for Network Programming
+12.5 Using 'gawk' for Network Programming
=========================================
'EMRED':
@@ -21600,7 +21657,7 @@ complete introduction and discussion, as well as
extensive examples.
File: gawk.info, Node: Profiling, Next: Extension Philosophy, Prev: TCP/IP
Networking, Up: Advanced Features
-12.5 Profiling Your 'awk' Programs
+12.6 Profiling Your 'awk' Programs
==================================
You may produce execution traces of your 'awk' programs. This is done
@@ -21862,7 +21919,7 @@ source code, it will appear that way in the output.
File: gawk.info, Node: Extension Philosophy, Next: Advanced Features
Summary, Prev: Profiling, Up: Advanced Features
-12.6 Builtin Features versus Extensions
+12.7 Builtin Features versus Extensions
=======================================
As this and subsequent major nodes show, 'gawk' has a large number of
@@ -21898,7 +21955,7 @@ or need.
File: gawk.info, Node: Advanced Features Summary, Prev: Extension
Philosophy, Up: Advanced Features
-12.7 Summary
+12.8 Summary
============
* The '--non-decimal-data' option causes 'gawk' to treat octal- and
@@ -35317,8 +35374,10 @@ Index
* bitwise, XOR: Bitwise Functions. (line 57)
* body, in actions: Statements. (line 10)
* body, in loops: While Statement. (line 14)
+* bool: Boolean Functions. (line 10)
* Boolean expressions: Boolean Ops. (line 6)
* Boolean expressions, as patterns: Expression Patterns. (line 39)
+* boolean function: Boolean Functions. (line 6)
* Bourne shell, quoting rules for: Quoting. (line 18)
* braces ({}), regexp operator: Regexp Operator Details.
(line 118)
@@ -38125,604 +38184,606 @@ Index
Tag Table:
Node: Top1200
-Node: Foreword344859
-Node: Foreword449301
-Node: Preface50833
-Ref: Preface-Footnote-153692
-Ref: Preface-Footnote-253801
-Ref: Preface-Footnote-354035
-Node: History54177
-Node: Names56529
-Ref: Names-Footnote-157633
-Node: This Manual57780
-Ref: This Manual-Footnote-164419
-Node: Conventions64519
-Node: Manual History66888
-Ref: Manual History-Footnote-169885
-Ref: Manual History-Footnote-269926
-Node: How To Contribute70000
-Node: Acknowledgments70926
-Node: Getting Started75863
-Node: Running gawk78302
-Node: One-shot79492
-Node: Read Terminal80755
-Node: Long82748
-Node: Executable Scripts84261
-Ref: Executable Scripts-Footnote-186894
-Node: Comments86997
-Node: Quoting89481
-Node: DOS Quoting95007
-Node: Sample Data Files97063
-Node: Very Simple99658
-Node: Two Rules105760
-Node: More Complex107645
-Node: Statements/Lines109977
-Ref: Statements/Lines-Footnote-1114461
-Node: Other Features114726
-Node: When115662
-Ref: When-Footnote-1117416
-Node: Intro Summary117481
-Node: Invoking Gawk118365
-Node: Command Line119879
-Node: Options120677
-Ref: Options-Footnote-1138591
-Ref: Options-Footnote-2138822
-Node: Other Arguments138847
-Node: Naming Standard Input142858
-Node: Environment Variables144068
-Node: AWKPATH Variable144626
-Ref: AWKPATH Variable-Footnote-1148038
-Ref: AWKPATH Variable-Footnote-2148072
-Node: AWKLIBPATH Variable148443
-Ref: AWKLIBPATH Variable-Footnote-1150140
-Node: Other Environment Variables150515
-Node: Exit Status154467
-Node: Include Files155144
-Node: Loading Shared Libraries158834
-Node: Obsolete160262
-Node: Undocumented160954
-Node: Invoking Summary161251
-Node: Regexp164092
-Node: Regexp Usage165546
-Node: Escape Sequences167583
-Node: Regexp Operators173824
-Node: Regexp Operator Details174309
-Ref: Regexp Operator Details-Footnote-1181673
-Node: Interval Expressions181820
-Ref: Interval Expressions-Footnote-1183241
-Node: Bracket Expressions183339
-Ref: table-char-classes185815
-Node: Leftmost Longest189141
-Node: Computed Regexps190444
-Node: GNU Regexp Operators193871
-Node: Case-sensitivity197608
-Ref: Case-sensitivity-Footnote-1200474
-Ref: Case-sensitivity-Footnote-2200709
-Node: Regexp Summary200817
-Node: Reading Files202283
-Node: Records204552
-Node: awk split records205627
-Node: gawk split records210327
-Ref: gawk split records-Footnote-1215401
-Node: Fields215438
-Node: Nonconstant Fields218179
-Ref: Nonconstant Fields-Footnote-1220415
-Node: Changing Fields220619
-Node: Field Separators226650
-Node: Default Field Splitting229348
-Node: Regexp Field Splitting230466
-Node: Single Character Fields234143
-Node: Command Line Field Separator235203
-Node: Full Line Fields238421
-Ref: Full Line Fields-Footnote-1239943
-Ref: Full Line Fields-Footnote-2239989
-Node: Field Splitting Summary240090
-Node: Constant Size242164
-Node: Fixed width data242896
-Node: Skipping intervening246363
-Node: Allowing trailing data247161
-Node: Fields with fixed data248198
-Node: Splitting By Content249716
-Ref: Splitting By Content-Footnote-1253499
-Node: More CSV253662
-Node: Testing field creation255254
-Node: Multiple Line256879
-Node: Getline263156
-Node: Plain Getline265625
-Node: Getline/Variable268198
-Node: Getline/File269349
-Node: Getline/Variable/File270737
-Ref: Getline/Variable/File-Footnote-1272342
-Node: Getline/Pipe272430
-Node: Getline/Variable/Pipe275134
-Node: Getline/Coprocess276269
-Node: Getline/Variable/Coprocess277536
-Node: Getline Notes278278
-Node: Getline Summary281075
-Ref: table-getline-variants281499
-Node: Read Timeout282247
-Ref: Read Timeout-Footnote-1286153
-Node: Retrying Input286211
-Node: Command-line directories287410
-Node: Input Summary288316
-Node: Input Exercises291488
-Node: Printing291922
-Node: Print293756
-Node: Print Examples295213
-Node: Output Separators297993
-Node: OFMT300010
-Node: Printf301366
-Node: Basic Printf302151
-Node: Control Letters303725
-Node: Format Modifiers308887
-Node: Printf Examples314902
-Node: Redirection317388
-Node: Special FD324229
-Ref: Special FD-Footnote-1327397
-Node: Special Files327471
-Node: Other Inherited Files328088
-Node: Special Network329089
-Node: Special Caveats329949
-Node: Close Files And Pipes330898
-Ref: table-close-pipe-return-values337805
-Ref: Close Files And Pipes-Footnote-1338618
-Ref: Close Files And Pipes-Footnote-2338766
-Node: Nonfatal338918
-Node: Output Summary341256
-Node: Output Exercises342478
-Node: Expressions343157
-Node: Values344345
-Node: Constants345023
-Node: Scalar Constants345714
-Ref: Scalar Constants-Footnote-1348224
-Node: Nondecimal-numbers348474
-Node: Regexp Constants351475
-Node: Using Constant Regexps352001
-Node: Standard Regexp Constants352623
-Node: Strong Regexp Constants355811
-Node: Variables358823
-Node: Using Variables359480
-Node: Assignment Options361390
-Node: Conversion363861
-Node: Strings And Numbers364385
-Ref: Strings And Numbers-Footnote-1367448
-Node: Locale influences conversions367557
-Ref: table-locale-affects370315
-Node: All Operators370933
-Node: Arithmetic Ops371562
-Node: Concatenation374278
-Ref: Concatenation-Footnote-1377125
-Node: Assignment Ops377232
-Ref: table-assign-ops382223
-Node: Increment Ops383536
-Node: Truth Values and Conditions386996
-Node: Truth Values388070
-Node: Typing and Comparison389118
-Node: Variable Typing389938
-Ref: Variable Typing-Footnote-1396401
-Ref: Variable Typing-Footnote-2396473
-Node: Comparison Operators396550
-Ref: table-relational-ops396969
-Node: POSIX String Comparison400464
-Ref: POSIX String Comparison-Footnote-1402159
-Ref: POSIX String Comparison-Footnote-2402298
-Node: Boolean Ops402382
-Ref: Boolean Ops-Footnote-1406864
-Node: Conditional Exp406956
-Node: Function Calls408692
-Node: Precedence412569
-Node: Locales416228
-Node: Expressions Summary417860
-Node: Patterns and Actions420433
-Node: Pattern Overview421553
-Node: Regexp Patterns423230
-Node: Expression Patterns423772
-Node: Ranges427553
-Node: BEGIN/END430661
-Node: Using BEGIN/END431422
-Ref: Using BEGIN/END-Footnote-1434176
-Node: I/O And BEGIN/END434282
-Node: BEGINFILE/ENDFILE436595
-Node: Empty439826
-Node: Using Shell Variables440143
-Node: Action Overview442417
-Node: Statements444742
-Node: If Statement446590
-Node: While Statement448085
-Node: Do Statement450113
-Node: For Statement451261
-Node: Switch Statement454432
-Node: Break Statement456873
-Node: Continue Statement458965
-Node: Next Statement460792
-Node: Nextfile Statement463175
-Node: Exit Statement465864
-Node: Built-in Variables468267
-Node: User-modified469400
-Node: Auto-set477167
-Ref: Auto-set-Footnote-1493974
-Ref: Auto-set-Footnote-2494180
-Node: ARGC and ARGV494236
-Node: Pattern Action Summary498449
-Node: Arrays500879
-Node: Array Basics502208
-Node: Array Intro503052
-Ref: figure-array-elements505027
-Ref: Array Intro-Footnote-1507731
-Node: Reference to Elements507859
-Node: Assigning Elements510323
-Node: Array Example510814
-Node: Scanning an Array512573
-Node: Controlling Scanning515595
-Ref: Controlling Scanning-Footnote-1522051
-Node: Numeric Array Subscripts522367
-Node: Uninitialized Subscripts524551
-Node: Delete526170
-Ref: Delete-Footnote-1528922
-Node: Multidimensional528979
-Node: Multiscanning532074
-Node: Arrays of Arrays533665
-Node: Arrays Summary538433
-Node: Functions540526
-Node: Built-in541564
-Node: Calling Built-in542645
-Node: Numeric Functions544641
-Ref: Numeric Functions-Footnote-1548667
-Ref: Numeric Functions-Footnote-2549315
-Ref: Numeric Functions-Footnote-3549363
-Node: String Functions549635
-Ref: String Functions-Footnote-1573776
-Ref: String Functions-Footnote-2573904
-Ref: String Functions-Footnote-3574152
-Node: Gory Details574239
-Ref: table-sub-escapes576030
-Ref: table-sub-proposed577549
-Ref: table-posix-sub578912
-Ref: table-gensub-escapes580453
-Ref: Gory Details-Footnote-1581276
-Node: I/O Functions581430
-Ref: table-system-return-values587884
-Ref: I/O Functions-Footnote-1589964
-Ref: I/O Functions-Footnote-2590112
-Node: Time Functions590232
-Ref: Time Functions-Footnote-1600903
-Ref: Time Functions-Footnote-2600971
-Ref: Time Functions-Footnote-3601129
-Ref: Time Functions-Footnote-4601240
-Ref: Time Functions-Footnote-5601352
-Ref: Time Functions-Footnote-6601579
-Node: Bitwise Functions601845
-Ref: table-bitwise-ops602439
-Ref: Bitwise Functions-Footnote-1608502
-Ref: Bitwise Functions-Footnote-2608675
-Node: Type Functions608866
-Node: I18N Functions611729
-Node: User-defined613380
-Node: Definition Syntax614192
-Ref: Definition Syntax-Footnote-1619886
-Node: Function Example619957
-Ref: Function Example-Footnote-1622879
-Node: Function Calling622901
-Node: Calling A Function623489
-Node: Variable Scope624447
-Node: Pass By Value/Reference627441
-Node: Function Caveats630085
-Ref: Function Caveats-Footnote-1632132
-Node: Return Statement632252
-Node: Dynamic Typing635231
-Node: Indirect Calls636161
-Ref: Indirect Calls-Footnote-1646413
-Node: Functions Summary646541
-Node: Library Functions649246
-Ref: Library Functions-Footnote-1652853
-Ref: Library Functions-Footnote-2652996
-Node: Library Names653167
-Ref: Library Names-Footnote-1656834
-Ref: Library Names-Footnote-2657057
-Node: General Functions657143
-Node: Strtonum Function658246
-Node: Assert Function661268
-Node: Round Function664594
-Node: Cliff Random Function666134
-Node: Ordinal Functions667150
-Ref: Ordinal Functions-Footnote-1670213
-Ref: Ordinal Functions-Footnote-2670465
-Node: Join Function670675
-Ref: Join Function-Footnote-1672445
-Node: Getlocaltime Function672645
-Node: Readfile Function676387
-Node: Shell Quoting678364
-Node: Data File Management679765
-Node: Filetrans Function680397
-Node: Rewind Function684493
-Node: File Checking686402
-Ref: File Checking-Footnote-1687736
-Node: Empty Files687937
-Node: Ignoring Assigns689916
-Node: Getopt Function691466
-Ref: Getopt Function-Footnote-1706677
-Node: Passwd Functions706877
-Ref: Passwd Functions-Footnote-1715716
-Node: Group Functions715804
-Ref: Group Functions-Footnote-1723702
-Node: Walking Arrays723909
-Node: Library Functions Summary726917
-Node: Library Exercises728323
-Node: Sample Programs728788
-Node: Running Examples729558
-Node: Clones730286
-Node: Cut Program731510
-Node: Egrep Program741650
-Node: Id Program750651
-Node: Split Program760598
-Ref: Split Program-Footnote-1770488
-Node: Tee Program770661
-Node: Uniq Program773451
-Node: Wc Program781039
-Node: Bytes vs. Characters781426
-Node: Using extensions782974
-Node: wc program783728
-Node: Miscellaneous Programs788593
-Node: Dupword Program789806
-Node: Alarm Program791836
-Node: Translate Program796691
-Ref: Translate Program-Footnote-1801256
-Node: Labels Program801526
-Ref: Labels Program-Footnote-1804877
-Node: Word Sorting804961
-Node: History Sorting809033
-Node: Extract Program811258
-Node: Simple Sed819312
-Node: Igawk Program822386
-Ref: Igawk Program-Footnote-1836717
-Ref: Igawk Program-Footnote-2836919
-Ref: Igawk Program-Footnote-3837041
-Node: Anagram Program837156
-Node: Signature Program840218
-Node: Programs Summary841465
-Node: Programs Exercises842679
-Ref: Programs Exercises-Footnote-1846809
-Node: Advanced Features846895
-Node: Nondecimal Data848962
-Node: Array Sorting850553
-Node: Controlling Array Traversal851253
-Ref: Controlling Array Traversal-Footnote-1859621
-Node: Array Sorting Functions859739
-Ref: Array Sorting Functions-Footnote-1864830
-Node: Two-way I/O865026
-Ref: Two-way I/O-Footnote-1872747
-Ref: Two-way I/O-Footnote-2872934
-Node: TCP/IP Networking873016
-Node: Profiling876134
-Node: Extension Philosophy885443
-Node: Advanced Features Summary886922
-Node: Internationalization888937
-Node: I18N and L10N890417
-Node: Explaining gettext891104
-Ref: Explaining gettext-Footnote-1896996
-Ref: Explaining gettext-Footnote-2897181
-Node: Programmer i18n897346
-Ref: Programmer i18n-Footnote-1902295
-Node: Translator i18n902344
-Node: String Extraction903138
-Ref: String Extraction-Footnote-1904270
-Node: Printf Ordering904356
-Ref: Printf Ordering-Footnote-1907142
-Node: I18N Portability907206
-Ref: I18N Portability-Footnote-1909662
-Node: I18N Example909725
-Ref: I18N Example-Footnote-1913000
-Ref: I18N Example-Footnote-2913073
-Node: Gawk I18N913182
-Node: I18N Summary913831
-Node: Debugger915172
-Node: Debugging916172
-Node: Debugging Concepts916613
-Node: Debugging Terms918422
-Node: Awk Debugging920997
-Ref: Awk Debugging-Footnote-1921942
-Node: Sample Debugging Session922074
-Node: Debugger Invocation922608
-Node: Finding The Bug923994
-Node: List of Debugger Commands930468
-Node: Breakpoint Control931801
-Node: Debugger Execution Control935495
-Node: Viewing And Changing Data938857
-Node: Execution Stack942398
-Node: Debugger Info944035
-Node: Miscellaneous Debugger Commands948106
-Node: Readline Support953168
-Node: Limitations954064
-Node: Debugging Summary956618
-Node: Namespaces957897
-Node: Global Namespace959008
-Node: Qualified Names960406
-Node: Default Namespace961405
-Node: Changing The Namespace962146
-Node: Naming Rules963760
-Node: Internal Name Management965608
-Node: Namespace Example966650
-Node: Namespace And Features969212
-Node: Namespace Summary970647
-Node: Arbitrary Precision Arithmetic972124
-Node: Computer Arithmetic973611
-Ref: table-numeric-ranges977377
-Ref: table-floating-point-ranges977870
-Ref: Computer Arithmetic-Footnote-1978528
-Node: Math Definitions978585
-Ref: table-ieee-formats981561
-Node: MPFR features982128
-Node: FP Math Caution983846
-Ref: FP Math Caution-Footnote-1984918
-Node: Inexactness of computations985287
-Node: Inexact representation986318
-Node: Comparing FP Values987678
-Node: Errors accumulate988919
-Node: Strange values990375
-Ref: Strange values-Footnote-1992963
-Node: Getting Accuracy993068
-Node: Try To Round995778
-Node: Setting precision996677
-Ref: table-predefined-precision-strings997374
-Node: Setting the rounding mode999204
-Ref: table-gawk-rounding-modes999578
-Ref: Setting the rounding mode-Footnote-11003509
-Node: Arbitrary Precision Integers1003688
-Ref: Arbitrary Precision Integers-Footnote-11006863
-Node: Checking for MPFR1007012
-Node: POSIX Floating Point Problems1008486
-Ref: POSIX Floating Point Problems-Footnote-11012771
-Node: Floating point summary1012809
-Node: Dynamic Extensions1014999
-Node: Extension Intro1016552
-Node: Plugin License1017818
-Node: Extension Mechanism Outline1018615
-Ref: figure-load-extension1019054
-Ref: figure-register-new-function1020619
-Ref: figure-call-new-function1021711
-Node: Extension API Description1023773
-Node: Extension API Functions Introduction1025486
-Ref: table-api-std-headers1027322
-Node: General Data Types1031571
-Ref: General Data Types-Footnote-11040277
-Node: Memory Allocation Functions1040576
-Ref: Memory Allocation Functions-Footnote-11045077
-Node: Constructor Functions1045176
-Node: API Ownership of MPFR and GMP Values1048829
-Node: Registration Functions1050142
-Node: Extension Functions1050842
-Node: Exit Callback Functions1056164
-Node: Extension Version String1057414
-Node: Input Parsers1058077
-Node: Output Wrappers1070798
-Node: Two-way processors1075310
-Node: Printing Messages1077575
-Ref: Printing Messages-Footnote-11078746
-Node: Updating ERRNO1078899
-Node: Requesting Values1079638
-Ref: table-value-types-returned1080375
-Node: Accessing Parameters1081483
-Node: Symbol Table Access1082720
-Node: Symbol table by name1083232
-Ref: Symbol table by name-Footnote-11086256
-Node: Symbol table by cookie1086384
-Ref: Symbol table by cookie-Footnote-11090569
-Node: Cached values1090633
-Ref: Cached values-Footnote-11094169
-Node: Array Manipulation1094322
-Ref: Array Manipulation-Footnote-11095413
-Node: Array Data Types1095450
-Ref: Array Data Types-Footnote-11098108
-Node: Array Functions1098200
-Node: Flattening Arrays1102698
-Node: Creating Arrays1109674
-Node: Redirection API1114441
-Node: Extension API Variables1117274
-Node: Extension Versioning1117985
-Ref: gawk-api-version1118414
-Node: Extension GMP/MPFR Versioning1120145
-Node: Extension API Informational Variables1121773
-Node: Extension API Boilerplate1122846
-Node: Changes from API V11126820
-Node: Finding Extensions1128392
-Node: Extension Example1128951
-Node: Internal File Description1129749
-Node: Internal File Ops1133829
-Ref: Internal File Ops-Footnote-11145179
-Node: Using Internal File Ops1145319
-Ref: Using Internal File Ops-Footnote-11147702
-Node: Extension Samples1147976
-Node: Extension Sample File Functions1149505
-Node: Extension Sample Fnmatch1157154
-Node: Extension Sample Fork1158641
-Node: Extension Sample Inplace1159859
-Node: Extension Sample Ord1163485
-Node: Extension Sample Readdir1164321
-Ref: table-readdir-file-types1165210
-Node: Extension Sample Revout1166277
-Node: Extension Sample Rev2way1166866
-Node: Extension Sample Read write array1167606
-Node: Extension Sample Readfile1169548
-Node: Extension Sample Time1170643
-Node: Extension Sample API Tests1172395
-Node: gawkextlib1172887
-Node: Extension summary1175805
-Node: Extension Exercises1179507
-Node: Language History1180749
-Node: V7/SVR3.11182405
-Node: SVR41184557
-Node: POSIX1185991
-Node: BTL1187372
-Node: POSIX/GNU1188101
-Node: Feature History1193879
-Node: Common Extensions1210198
-Node: Ranges and Locales1211481
-Ref: Ranges and Locales-Footnote-11216097
-Ref: Ranges and Locales-Footnote-21216124
-Ref: Ranges and Locales-Footnote-31216359
-Node: Contributors1216582
-Node: History summary1222579
-Node: Installation1223959
-Node: Gawk Distribution1224903
-Node: Getting1225387
-Node: Extracting1226350
-Node: Distribution contents1227988
-Node: Unix Installation1234468
-Node: Quick Installation1235150
-Node: Shell Startup Files1237564
-Node: Additional Configuration Options1238653
-Node: Configuration Philosophy1240968
-Node: Non-Unix Installation1243337
-Node: PC Installation1243797
-Node: PC Binary Installation1244635
-Node: PC Compiling1245070
-Node: PC Using1246187
-Node: Cygwin1249740
-Node: MSYS1250964
-Node: VMS Installation1251566
-Node: VMS Compilation1252357
-Ref: VMS Compilation-Footnote-11253586
-Node: VMS Dynamic Extensions1253644
-Node: VMS Installation Details1255329
-Node: VMS Running1257582
-Node: VMS GNV1261861
-Node: VMS Old Gawk1262596
-Node: Bugs1263067
-Node: Bug address1263730
-Node: Usenet1266712
-Node: Maintainers1267716
-Node: Other Versions1268901
-Node: Installation summary1276766
-Node: Notes1277975
-Node: Compatibility Mode1278769
-Node: Additions1279551
-Node: Accessing The Source1280476
-Node: Adding Code1281913
-Node: New Ports1288132
-Node: Derived Files1292507
-Ref: Derived Files-Footnote-11298167
-Ref: Derived Files-Footnote-21298202
-Ref: Derived Files-Footnote-31298800
-Node: Future Extensions1298914
-Node: Implementation Limitations1299572
-Node: Extension Design1300782
-Node: Old Extension Problems1301926
-Ref: Old Extension Problems-Footnote-11303444
-Node: Extension New Mechanism Goals1303501
-Ref: Extension New Mechanism Goals-Footnote-11306865
-Node: Extension Other Design Decisions1307054
-Node: Extension Future Growth1309167
-Node: Notes summary1309773
-Node: Basic Concepts1310931
-Node: Basic High Level1311612
-Ref: figure-general-flow1311894
-Ref: figure-process-flow1312579
-Ref: Basic High Level-Footnote-11315880
-Node: Basic Data Typing1316065
-Node: Glossary1319393
-Node: Copying1351278
-Node: GNU Free Documentation License1388821
-Node: Index1413941
+Node: Foreword345044
+Node: Foreword449486
+Node: Preface51018
+Ref: Preface-Footnote-153877
+Ref: Preface-Footnote-253986
+Ref: Preface-Footnote-354220
+Node: History54362
+Node: Names56714
+Ref: Names-Footnote-157818
+Node: This Manual57965
+Ref: This Manual-Footnote-164604
+Node: Conventions64704
+Node: Manual History67073
+Ref: Manual History-Footnote-170070
+Ref: Manual History-Footnote-270111
+Node: How To Contribute70185
+Node: Acknowledgments71111
+Node: Getting Started76048
+Node: Running gawk78487
+Node: One-shot79677
+Node: Read Terminal80940
+Node: Long82933
+Node: Executable Scripts84446
+Ref: Executable Scripts-Footnote-187079
+Node: Comments87182
+Node: Quoting89666
+Node: DOS Quoting95192
+Node: Sample Data Files97248
+Node: Very Simple99843
+Node: Two Rules105945
+Node: More Complex107830
+Node: Statements/Lines110162
+Ref: Statements/Lines-Footnote-1114646
+Node: Other Features114911
+Node: When115847
+Ref: When-Footnote-1117601
+Node: Intro Summary117666
+Node: Invoking Gawk118550
+Node: Command Line120064
+Node: Options120862
+Ref: Options-Footnote-1138776
+Ref: Options-Footnote-2139007
+Node: Other Arguments139032
+Node: Naming Standard Input143043
+Node: Environment Variables144253
+Node: AWKPATH Variable144811
+Ref: AWKPATH Variable-Footnote-1148223
+Ref: AWKPATH Variable-Footnote-2148257
+Node: AWKLIBPATH Variable148628
+Ref: AWKLIBPATH Variable-Footnote-1150325
+Node: Other Environment Variables150700
+Node: Exit Status154652
+Node: Include Files155329
+Node: Loading Shared Libraries159019
+Node: Obsolete160447
+Node: Undocumented161139
+Node: Invoking Summary161436
+Node: Regexp164277
+Node: Regexp Usage165731
+Node: Escape Sequences167768
+Node: Regexp Operators174009
+Node: Regexp Operator Details174494
+Ref: Regexp Operator Details-Footnote-1181858
+Node: Interval Expressions182005
+Ref: Interval Expressions-Footnote-1183426
+Node: Bracket Expressions183524
+Ref: table-char-classes186000
+Node: Leftmost Longest189326
+Node: Computed Regexps190629
+Node: GNU Regexp Operators194056
+Node: Case-sensitivity197793
+Ref: Case-sensitivity-Footnote-1200659
+Ref: Case-sensitivity-Footnote-2200894
+Node: Regexp Summary201002
+Node: Reading Files202468
+Node: Records204737
+Node: awk split records205812
+Node: gawk split records210512
+Ref: gawk split records-Footnote-1215586
+Node: Fields215623
+Node: Nonconstant Fields218364
+Ref: Nonconstant Fields-Footnote-1220600
+Node: Changing Fields220804
+Node: Field Separators226835
+Node: Default Field Splitting229533
+Node: Regexp Field Splitting230651
+Node: Single Character Fields234328
+Node: Command Line Field Separator235388
+Node: Full Line Fields238606
+Ref: Full Line Fields-Footnote-1240128
+Ref: Full Line Fields-Footnote-2240174
+Node: Field Splitting Summary240275
+Node: Constant Size242349
+Node: Fixed width data243081
+Node: Skipping intervening246548
+Node: Allowing trailing data247346
+Node: Fields with fixed data248383
+Node: Splitting By Content249901
+Ref: Splitting By Content-Footnote-1253684
+Node: More CSV253847
+Node: Testing field creation255439
+Node: Multiple Line257064
+Node: Getline263341
+Node: Plain Getline265810
+Node: Getline/Variable268383
+Node: Getline/File269534
+Node: Getline/Variable/File270922
+Ref: Getline/Variable/File-Footnote-1272527
+Node: Getline/Pipe272615
+Node: Getline/Variable/Pipe275319
+Node: Getline/Coprocess276454
+Node: Getline/Variable/Coprocess277721
+Node: Getline Notes278463
+Node: Getline Summary281260
+Ref: table-getline-variants281684
+Node: Read Timeout282432
+Ref: Read Timeout-Footnote-1286338
+Node: Retrying Input286396
+Node: Command-line directories287595
+Node: Input Summary288501
+Node: Input Exercises291673
+Node: Printing292107
+Node: Print293941
+Node: Print Examples295398
+Node: Output Separators298178
+Node: OFMT300195
+Node: Printf301551
+Node: Basic Printf302336
+Node: Control Letters303910
+Node: Format Modifiers309072
+Node: Printf Examples315087
+Node: Redirection317573
+Node: Special FD324414
+Ref: Special FD-Footnote-1327582
+Node: Special Files327656
+Node: Other Inherited Files328273
+Node: Special Network329274
+Node: Special Caveats330134
+Node: Close Files And Pipes331083
+Ref: table-close-pipe-return-values337990
+Ref: Close Files And Pipes-Footnote-1338803
+Ref: Close Files And Pipes-Footnote-2338951
+Node: Nonfatal339103
+Node: Output Summary341441
+Node: Output Exercises342663
+Node: Expressions343342
+Node: Values344530
+Node: Constants345208
+Node: Scalar Constants345899
+Ref: Scalar Constants-Footnote-1348409
+Node: Nondecimal-numbers348659
+Node: Regexp Constants351660
+Node: Using Constant Regexps352186
+Node: Standard Regexp Constants352808
+Node: Strong Regexp Constants355996
+Node: Variables359008
+Node: Using Variables359665
+Node: Assignment Options361575
+Node: Conversion364046
+Node: Strings And Numbers364570
+Ref: Strings And Numbers-Footnote-1367633
+Node: Locale influences conversions367742
+Ref: table-locale-affects370500
+Node: All Operators371118
+Node: Arithmetic Ops371747
+Node: Concatenation374463
+Ref: Concatenation-Footnote-1377310
+Node: Assignment Ops377417
+Ref: table-assign-ops382408
+Node: Increment Ops383721
+Node: Truth Values and Conditions387181
+Node: Truth Values388255
+Node: Typing and Comparison389303
+Node: Variable Typing390123
+Ref: Variable Typing-Footnote-1396586
+Ref: Variable Typing-Footnote-2396658
+Node: Comparison Operators396735
+Ref: table-relational-ops397154
+Node: POSIX String Comparison400649
+Ref: POSIX String Comparison-Footnote-1402344
+Ref: POSIX String Comparison-Footnote-2402483
+Node: Boolean Ops402567
+Ref: Boolean Ops-Footnote-1407049
+Node: Conditional Exp407141
+Node: Function Calls408877
+Node: Precedence412754
+Node: Locales416413
+Node: Expressions Summary418045
+Node: Patterns and Actions420618
+Node: Pattern Overview421738
+Node: Regexp Patterns423415
+Node: Expression Patterns423957
+Node: Ranges427738
+Node: BEGIN/END430846
+Node: Using BEGIN/END431607
+Ref: Using BEGIN/END-Footnote-1434361
+Node: I/O And BEGIN/END434467
+Node: BEGINFILE/ENDFILE436780
+Node: Empty440011
+Node: Using Shell Variables440328
+Node: Action Overview442602
+Node: Statements444927
+Node: If Statement446775
+Node: While Statement448270
+Node: Do Statement450298
+Node: For Statement451446
+Node: Switch Statement454617
+Node: Break Statement457058
+Node: Continue Statement459150
+Node: Next Statement460977
+Node: Nextfile Statement463360
+Node: Exit Statement466049
+Node: Built-in Variables468452
+Node: User-modified469585
+Node: Auto-set477352
+Ref: Auto-set-Footnote-1494159
+Ref: Auto-set-Footnote-2494365
+Node: ARGC and ARGV494421
+Node: Pattern Action Summary498634
+Node: Arrays501064
+Node: Array Basics502393
+Node: Array Intro503237
+Ref: figure-array-elements505212
+Ref: Array Intro-Footnote-1507916
+Node: Reference to Elements508044
+Node: Assigning Elements510508
+Node: Array Example510999
+Node: Scanning an Array512758
+Node: Controlling Scanning515780
+Ref: Controlling Scanning-Footnote-1522236
+Node: Numeric Array Subscripts522552
+Node: Uninitialized Subscripts524736
+Node: Delete526355
+Ref: Delete-Footnote-1529107
+Node: Multidimensional529164
+Node: Multiscanning532259
+Node: Arrays of Arrays533850
+Node: Arrays Summary538618
+Node: Functions540711
+Node: Built-in541749
+Node: Calling Built-in542902
+Node: Boolean Functions544898
+Node: Numeric Functions545211
+Ref: Numeric Functions-Footnote-1549238
+Ref: Numeric Functions-Footnote-2549886
+Ref: Numeric Functions-Footnote-3549934
+Node: String Functions550206
+Ref: String Functions-Footnote-1574347
+Ref: String Functions-Footnote-2574475
+Ref: String Functions-Footnote-3574723
+Node: Gory Details574810
+Ref: table-sub-escapes576601
+Ref: table-sub-proposed578120
+Ref: table-posix-sub579483
+Ref: table-gensub-escapes581024
+Ref: Gory Details-Footnote-1581847
+Node: I/O Functions582001
+Ref: table-system-return-values588455
+Ref: I/O Functions-Footnote-1590535
+Ref: I/O Functions-Footnote-2590683
+Node: Time Functions590803
+Ref: Time Functions-Footnote-1601474
+Ref: Time Functions-Footnote-2601542
+Ref: Time Functions-Footnote-3601700
+Ref: Time Functions-Footnote-4601811
+Ref: Time Functions-Footnote-5601923
+Ref: Time Functions-Footnote-6602150
+Node: Bitwise Functions602416
+Ref: table-bitwise-ops603010
+Ref: Bitwise Functions-Footnote-1609073
+Ref: Bitwise Functions-Footnote-2609246
+Node: Type Functions609437
+Node: I18N Functions612300
+Node: User-defined613951
+Node: Definition Syntax614763
+Ref: Definition Syntax-Footnote-1620457
+Node: Function Example620528
+Ref: Function Example-Footnote-1623450
+Node: Function Calling623472
+Node: Calling A Function624060
+Node: Variable Scope625018
+Node: Pass By Value/Reference628012
+Node: Function Caveats630656
+Ref: Function Caveats-Footnote-1632703
+Node: Return Statement632823
+Node: Dynamic Typing635802
+Node: Indirect Calls636732
+Ref: Indirect Calls-Footnote-1646987
+Node: Functions Summary647115
+Node: Library Functions649820
+Ref: Library Functions-Footnote-1653427
+Ref: Library Functions-Footnote-2653570
+Node: Library Names653741
+Ref: Library Names-Footnote-1657408
+Ref: Library Names-Footnote-2657631
+Node: General Functions657717
+Node: Strtonum Function658820
+Node: Assert Function661842
+Node: Round Function665168
+Node: Cliff Random Function666708
+Node: Ordinal Functions667724
+Ref: Ordinal Functions-Footnote-1670787
+Ref: Ordinal Functions-Footnote-2671039
+Node: Join Function671249
+Ref: Join Function-Footnote-1673019
+Node: Getlocaltime Function673219
+Node: Readfile Function676961
+Node: Shell Quoting678938
+Node: Data File Management680339
+Node: Filetrans Function680971
+Node: Rewind Function685067
+Node: File Checking686976
+Ref: File Checking-Footnote-1688310
+Node: Empty Files688511
+Node: Ignoring Assigns690490
+Node: Getopt Function692040
+Ref: Getopt Function-Footnote-1707251
+Node: Passwd Functions707451
+Ref: Passwd Functions-Footnote-1716290
+Node: Group Functions716378
+Ref: Group Functions-Footnote-1724276
+Node: Walking Arrays724483
+Node: Library Functions Summary727491
+Node: Library Exercises728897
+Node: Sample Programs729362
+Node: Running Examples730132
+Node: Clones730860
+Node: Cut Program732084
+Node: Egrep Program742224
+Node: Id Program751225
+Node: Split Program761172
+Ref: Split Program-Footnote-1771062
+Node: Tee Program771235
+Node: Uniq Program774025
+Node: Wc Program781613
+Node: Bytes vs. Characters782000
+Node: Using extensions783548
+Node: wc program784302
+Node: Miscellaneous Programs789167
+Node: Dupword Program790380
+Node: Alarm Program792410
+Node: Translate Program797265
+Ref: Translate Program-Footnote-1801830
+Node: Labels Program802100
+Ref: Labels Program-Footnote-1805451
+Node: Word Sorting805535
+Node: History Sorting809607
+Node: Extract Program811832
+Node: Simple Sed819886
+Node: Igawk Program822960
+Ref: Igawk Program-Footnote-1837291
+Ref: Igawk Program-Footnote-2837493
+Ref: Igawk Program-Footnote-3837615
+Node: Anagram Program837730
+Node: Signature Program840792
+Node: Programs Summary842039
+Node: Programs Exercises843253
+Ref: Programs Exercises-Footnote-1847383
+Node: Advanced Features847469
+Node: Nondecimal Data849593
+Node: Boolean Typed Values851191
+Node: Array Sorting852815
+Node: Controlling Array Traversal853520
+Ref: Controlling Array Traversal-Footnote-1861888
+Node: Array Sorting Functions862006
+Ref: Array Sorting Functions-Footnote-1867097
+Node: Two-way I/O867293
+Ref: Two-way I/O-Footnote-1875014
+Ref: Two-way I/O-Footnote-2875201
+Node: TCP/IP Networking875283
+Node: Profiling878401
+Node: Extension Philosophy887710
+Node: Advanced Features Summary889189
+Node: Internationalization891204
+Node: I18N and L10N892684
+Node: Explaining gettext893371
+Ref: Explaining gettext-Footnote-1899263
+Ref: Explaining gettext-Footnote-2899448
+Node: Programmer i18n899613
+Ref: Programmer i18n-Footnote-1904562
+Node: Translator i18n904611
+Node: String Extraction905405
+Ref: String Extraction-Footnote-1906537
+Node: Printf Ordering906623
+Ref: Printf Ordering-Footnote-1909409
+Node: I18N Portability909473
+Ref: I18N Portability-Footnote-1911929
+Node: I18N Example911992
+Ref: I18N Example-Footnote-1915267
+Ref: I18N Example-Footnote-2915340
+Node: Gawk I18N915449
+Node: I18N Summary916098
+Node: Debugger917439
+Node: Debugging918439
+Node: Debugging Concepts918880
+Node: Debugging Terms920689
+Node: Awk Debugging923264
+Ref: Awk Debugging-Footnote-1924209
+Node: Sample Debugging Session924341
+Node: Debugger Invocation924875
+Node: Finding The Bug926261
+Node: List of Debugger Commands932735
+Node: Breakpoint Control934068
+Node: Debugger Execution Control937762
+Node: Viewing And Changing Data941124
+Node: Execution Stack944665
+Node: Debugger Info946302
+Node: Miscellaneous Debugger Commands950373
+Node: Readline Support955435
+Node: Limitations956331
+Node: Debugging Summary958885
+Node: Namespaces960164
+Node: Global Namespace961275
+Node: Qualified Names962673
+Node: Default Namespace963672
+Node: Changing The Namespace964413
+Node: Naming Rules966027
+Node: Internal Name Management967875
+Node: Namespace Example968917
+Node: Namespace And Features971479
+Node: Namespace Summary972914
+Node: Arbitrary Precision Arithmetic974391
+Node: Computer Arithmetic975878
+Ref: table-numeric-ranges979644
+Ref: table-floating-point-ranges980137
+Ref: Computer Arithmetic-Footnote-1980795
+Node: Math Definitions980852
+Ref: table-ieee-formats983828
+Node: MPFR features984395
+Node: FP Math Caution986113
+Ref: FP Math Caution-Footnote-1987185
+Node: Inexactness of computations987554
+Node: Inexact representation988585
+Node: Comparing FP Values989945
+Node: Errors accumulate991186
+Node: Strange values992642
+Ref: Strange values-Footnote-1995230
+Node: Getting Accuracy995335
+Node: Try To Round998045
+Node: Setting precision998944
+Ref: table-predefined-precision-strings999641
+Node: Setting the rounding mode1001471
+Ref: table-gawk-rounding-modes1001845
+Ref: Setting the rounding mode-Footnote-11005776
+Node: Arbitrary Precision Integers1005955
+Ref: Arbitrary Precision Integers-Footnote-11009130
+Node: Checking for MPFR1009279
+Node: POSIX Floating Point Problems1010753
+Ref: POSIX Floating Point Problems-Footnote-11015038
+Node: Floating point summary1015076
+Node: Dynamic Extensions1017266
+Node: Extension Intro1018819
+Node: Plugin License1020085
+Node: Extension Mechanism Outline1020882
+Ref: figure-load-extension1021321
+Ref: figure-register-new-function1022886
+Ref: figure-call-new-function1023978
+Node: Extension API Description1026040
+Node: Extension API Functions Introduction1027753
+Ref: table-api-std-headers1029589
+Node: General Data Types1033838
+Ref: General Data Types-Footnote-11042544
+Node: Memory Allocation Functions1042843
+Ref: Memory Allocation Functions-Footnote-11047344
+Node: Constructor Functions1047443
+Node: API Ownership of MPFR and GMP Values1051096
+Node: Registration Functions1052409
+Node: Extension Functions1053109
+Node: Exit Callback Functions1058431
+Node: Extension Version String1059681
+Node: Input Parsers1060344
+Node: Output Wrappers1073065
+Node: Two-way processors1077577
+Node: Printing Messages1079842
+Ref: Printing Messages-Footnote-11081013
+Node: Updating ERRNO1081166
+Node: Requesting Values1081905
+Ref: table-value-types-returned1082642
+Node: Accessing Parameters1083750
+Node: Symbol Table Access1084987
+Node: Symbol table by name1085499
+Ref: Symbol table by name-Footnote-11088523
+Node: Symbol table by cookie1088651
+Ref: Symbol table by cookie-Footnote-11092836
+Node: Cached values1092900
+Ref: Cached values-Footnote-11096436
+Node: Array Manipulation1096589
+Ref: Array Manipulation-Footnote-11097680
+Node: Array Data Types1097717
+Ref: Array Data Types-Footnote-11100375
+Node: Array Functions1100467
+Node: Flattening Arrays1104965
+Node: Creating Arrays1111941
+Node: Redirection API1116708
+Node: Extension API Variables1119541
+Node: Extension Versioning1120252
+Ref: gawk-api-version1120681
+Node: Extension GMP/MPFR Versioning1122412
+Node: Extension API Informational Variables1124040
+Node: Extension API Boilerplate1125113
+Node: Changes from API V11129087
+Node: Finding Extensions1130659
+Node: Extension Example1131218
+Node: Internal File Description1132016
+Node: Internal File Ops1136096
+Ref: Internal File Ops-Footnote-11147446
+Node: Using Internal File Ops1147586
+Ref: Using Internal File Ops-Footnote-11149969
+Node: Extension Samples1150243
+Node: Extension Sample File Functions1151772
+Node: Extension Sample Fnmatch1159421
+Node: Extension Sample Fork1160908
+Node: Extension Sample Inplace1162126
+Node: Extension Sample Ord1165752
+Node: Extension Sample Readdir1166588
+Ref: table-readdir-file-types1167477
+Node: Extension Sample Revout1168544
+Node: Extension Sample Rev2way1169133
+Node: Extension Sample Read write array1169873
+Node: Extension Sample Readfile1171815
+Node: Extension Sample Time1172910
+Node: Extension Sample API Tests1174662
+Node: gawkextlib1175154
+Node: Extension summary1178072
+Node: Extension Exercises1181774
+Node: Language History1183016
+Node: V7/SVR3.11184672
+Node: SVR41186824
+Node: POSIX1188258
+Node: BTL1189639
+Node: POSIX/GNU1190368
+Node: Feature History1196146
+Node: Common Extensions1212465
+Node: Ranges and Locales1213748
+Ref: Ranges and Locales-Footnote-11218364
+Ref: Ranges and Locales-Footnote-21218391
+Ref: Ranges and Locales-Footnote-31218626
+Node: Contributors1218849
+Node: History summary1224846
+Node: Installation1226226
+Node: Gawk Distribution1227170
+Node: Getting1227654
+Node: Extracting1228617
+Node: Distribution contents1230255
+Node: Unix Installation1236735
+Node: Quick Installation1237417
+Node: Shell Startup Files1239831
+Node: Additional Configuration Options1240920
+Node: Configuration Philosophy1243235
+Node: Non-Unix Installation1245604
+Node: PC Installation1246064
+Node: PC Binary Installation1246902
+Node: PC Compiling1247337
+Node: PC Using1248454
+Node: Cygwin1252007
+Node: MSYS1253231
+Node: VMS Installation1253833
+Node: VMS Compilation1254624
+Ref: VMS Compilation-Footnote-11255853
+Node: VMS Dynamic Extensions1255911
+Node: VMS Installation Details1257596
+Node: VMS Running1259849
+Node: VMS GNV1264128
+Node: VMS Old Gawk1264863
+Node: Bugs1265334
+Node: Bug address1265997
+Node: Usenet1268979
+Node: Maintainers1269983
+Node: Other Versions1271168
+Node: Installation summary1279033
+Node: Notes1280242
+Node: Compatibility Mode1281036
+Node: Additions1281818
+Node: Accessing The Source1282743
+Node: Adding Code1284180
+Node: New Ports1290399
+Node: Derived Files1294774
+Ref: Derived Files-Footnote-11300434
+Ref: Derived Files-Footnote-21300469
+Ref: Derived Files-Footnote-31301067
+Node: Future Extensions1301181
+Node: Implementation Limitations1301839
+Node: Extension Design1303049
+Node: Old Extension Problems1304193
+Ref: Old Extension Problems-Footnote-11305711
+Node: Extension New Mechanism Goals1305768
+Ref: Extension New Mechanism Goals-Footnote-11309132
+Node: Extension Other Design Decisions1309321
+Node: Extension Future Growth1311434
+Node: Notes summary1312040
+Node: Basic Concepts1313198
+Node: Basic High Level1313879
+Ref: figure-general-flow1314161
+Ref: figure-process-flow1314846
+Ref: Basic High Level-Footnote-11318147
+Node: Basic Data Typing1318332
+Node: Glossary1321660
+Node: Copying1353545
+Node: GNU Free Documentation License1391088
+Node: Index1416208
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 88b0a2c..280b316 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -754,6 +754,8 @@ particular records in a file and perform operations upon
them.
* Arrays Summary:: Summary of arrays.
* Built-in:: Summarizes the built-in functions.
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean
+ values.
* Numeric Functions:: Functions that work with numbers,
including @code{int()}, @code{sin()}
and @code{rand()}.
@@ -861,6 +863,7 @@ particular records in a file and perform operations upon
them.
* Programs Summary:: Summary of programs.
* Programs Exercises:: Exercises.
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with @code{bool} type.
* Array Sorting:: Facilities for controlling array
traversal and sorting arrays.
* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
@@ -18307,6 +18310,7 @@ but are summarized here for your convenience.
@menu
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean values.
* Numeric Functions:: Functions that work with numbers, including
@code{int()}, @code{sin()} and @code{rand()}.
* String Functions:: Functions for string manipulation, such as
@@ -18376,6 +18380,22 @@ and 12. But if the order of evaluation is right to
left, @code{i}
first becomes 10, then 11, and @code{atan2()} is called with the
two arguments 11 and 10.
+
+@node Boolean Functions
+@subsection Generating Boolean Values
+@cindex boolean function
+
+This functions is specific to @command{gawk}. It is not
+available in compatibility mode (@pxref{Options}):
+
+@c @asis for docbook
+@table @asis
+@item @code{bool(@var{expression})}
+@cindexgawkfunc{bool}
+
+blah blah
+@end table
+
@node Numeric Functions
@subsection Numeric Functions
@cindex numeric @subentry functions
@@ -21776,7 +21796,7 @@ being aware of them.
@cindex pointers to functions
@cindex differences in @command{awk} and @command{gawk} @subentry indirect
function calls
-This section describes an advanced, @command{gawk}-specific extension.
+This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
Often, you may wish to defer the choice of function to call until runtime.
For example, you may have different kinds of records, each of which
@@ -29385,6 +29405,7 @@ discusses the ability to dynamically add new built-in
functions to
@menu
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with @code{bool} type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -29451,6 +29472,42 @@ leads to less surprising results.
This option may disappear in a future version of @command{gawk}.
@end quotation
+@node Boolean Typed Values
+@section Boolean Typed Values
+
+This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
+
+Scalar values in @command{awk} are either numbers or strings.
+@command{gawk} also supports values of type @code{regexp} (FIXME pxref).
+
+As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a
separate
+type: a value counts as ``true'' if it is nonzero or non-null, and as
+``false'' otherwise.
+
+When interchanging data with languages that do have a real Boolean type,
+using a standard format such as JSON or XML, the lack of a true Boolean
+type in @command{awk} is problematic. (FIXME: xref to gawkextlib json
+extension)
+
+It's easy to import Boolean data into @command{awk}, but then the fact
+that it was originally Boolean is lost. Exporting data is even harder;
+there's no way to indicate that a value is really Boolean.
+
+To solve this problem, @command{gawk} provides a function named @code{bool()}.
+It takes one argument, which is any @command{awk} expression, and it
+returns a value of Boolean type.
+
+The returned values are different than
+normal @command{awk} values. When treated as numbers, they are either
+one or zero, depending upon the truth value of the expression passed
+in the call. When treated as strings, they are either @code{"TRUE"}
+or @code{"FALSE"}, again depending upon the truth value of the expression
passed
+in the call. The value for ``false'' is thus unusual; it is zero numerically,
+but not empty when treated as a string.
+
+The @code{typeof()} function (FIXME pxref here) returns @code{"bool"}
+for these values.
+
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 598d6a1..6937cec 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -749,6 +749,8 @@ particular records in a file and perform operations upon
them.
* Arrays Summary:: Summary of arrays.
* Built-in:: Summarizes the built-in functions.
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean
+ values.
* Numeric Functions:: Functions that work with numbers,
including @code{int()}, @code{sin()}
and @code{rand()}.
@@ -856,6 +858,7 @@ particular records in a file and perform operations upon
them.
* Programs Summary:: Summary of programs.
* Programs Exercises:: Exercises.
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with @code{bool} type.
* Array Sorting:: Facilities for controlling array
traversal and sorting arrays.
* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
@@ -17448,6 +17451,7 @@ but are summarized here for your convenience.
@menu
* Calling Built-in:: How to call built-in functions.
+* Boolean Functions:: A function that returns Boolean values.
* Numeric Functions:: Functions that work with numbers, including
@code{int()}, @code{sin()} and @code{rand()}.
* String Functions:: Functions for string manipulation, such as
@@ -17517,6 +17521,22 @@ and 12. But if the order of evaluation is right to
left, @code{i}
first becomes 10, then 11, and @code{atan2()} is called with the
two arguments 11 and 10.
+
+@node Boolean Functions
+@subsection Generating Boolean Values
+@cindex boolean function
+
+This functions is specific to @command{gawk}. It is not
+available in compatibility mode (@pxref{Options}):
+
+@c @asis for docbook
+@table @asis
+@item @code{bool(@var{expression})}
+@cindexgawkfunc{bool}
+
+blah blah
+@end table
+
@node Numeric Functions
@subsection Numeric Functions
@cindex numeric @subentry functions
@@ -20688,7 +20708,7 @@ being aware of them.
@cindex pointers to functions
@cindex differences in @command{awk} and @command{gawk} @subentry indirect
function calls
-This section describes an advanced, @command{gawk}-specific extension.
+This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
Often, you may wish to defer the choice of function to call until runtime.
For example, you may have different kinds of records, each of which
@@ -28267,6 +28287,7 @@ discusses the ability to dynamically add new built-in
functions to
@menu
* Nondecimal Data:: Allowing nondecimal input data.
+* Boolean Typed Values:: Values with @code{bool} type.
* Array Sorting:: Facilities for controlling array traversal and
sorting arrays.
* Two-way I/O:: Two-way communications with another process.
@@ -28333,6 +28354,42 @@ leads to less surprising results.
This option may disappear in a future version of @command{gawk}.
@end quotation
+@node Boolean Typed Values
+@section Boolean Typed Values
+
+This @value{SECTION} describes an advanced, @command{gawk}-specific extension.
+
+Scalar values in @command{awk} are either numbers or strings.
+@command{gawk} also supports values of type @code{regexp} (FIXME pxref).
+
+As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a
separate
+type: a value counts as ``true'' if it is nonzero or non-null, and as
+``false'' otherwise.
+
+When interchanging data with languages that do have a real Boolean type,
+using a standard format such as JSON or XML, the lack of a true Boolean
+type in @command{awk} is problematic. (FIXME: xref to gawkextlib json
+extension)
+
+It's easy to import Boolean data into @command{awk}, but then the fact
+that it was originally Boolean is lost. Exporting data is even harder;
+there's no way to indicate that a value is really Boolean.
+
+To solve this problem, @command{gawk} provides a function named @code{bool()}.
+It takes one argument, which is any @command{awk} expression, and it
+returns a value of Boolean type.
+
+The returned values are different than
+normal @command{awk} values. When treated as numbers, they are either
+one or zero, depending upon the truth value of the expression passed
+in the call. When treated as strings, they are either @code{"TRUE"}
+or @code{"FALSE"}, again depending upon the truth value of the expression
passed
+in the call. The value for ``false'' is thus unusual; it is zero numerically,
+but not empty when treated as a string.
+
+The @code{typeof()} function (FIXME pxref here) returns @code{"bool"}
+for these values.
+
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a028ecdab76a663e0b12308e2cf9147f38dba6d2
commit a028ecdab76a663e0b12308e2cf9147f38dba6d2
Merge: 1a870d5 ffb61f1
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Apr 4 22:05:43 2021 +0300
Merge branch 'master' into feature/bool
diff --cc doc/gawk.info
index 2200e99,f5f417a..057f18d
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@@ -38121,604 -38116,604 +38125,604 @@@ Inde
Tag Table:
Node: Top1200
- Node: Foreword344638
- Node: Foreword449080
- Node: Preface50612
- Ref: Preface-Footnote-153471
- Ref: Preface-Footnote-253580
- Ref: Preface-Footnote-353814
- Node: History53956
- Node: Names56308
- Ref: Names-Footnote-157412
- Node: This Manual57559
- Ref: This Manual-Footnote-164198
- Node: Conventions64298
- Node: Manual History66667
- Ref: Manual History-Footnote-169664
- Ref: Manual History-Footnote-269705
- Node: How To Contribute69779
- Node: Acknowledgments70705
- Node: Getting Started75642
- Node: Running gawk78081
- Node: One-shot79271
- Node: Read Terminal80534
- Node: Long82527
- Node: Executable Scripts84040
- Ref: Executable Scripts-Footnote-186673
- Node: Comments86776
- Node: Quoting89260
- Node: DOS Quoting94786
- Node: Sample Data Files96842
- Node: Very Simple99437
- Node: Two Rules105539
- Node: More Complex107424
- Node: Statements/Lines109756
- Ref: Statements/Lines-Footnote-1114240
- Node: Other Features114505
- Node: When115441
- Ref: When-Footnote-1117195
- Node: Intro Summary117260
- Node: Invoking Gawk118144
- Node: Command Line119658
- Node: Options120456
- Ref: Options-Footnote-1138370
- Ref: Options-Footnote-2138601
- Node: Other Arguments138626
- Node: Naming Standard Input142637
- Node: Environment Variables143847
- Node: AWKPATH Variable144405
- Ref: AWKPATH Variable-Footnote-1147817
- Ref: AWKPATH Variable-Footnote-2147851
- Node: AWKLIBPATH Variable148222
- Ref: AWKLIBPATH Variable-Footnote-1149919
- Node: Other Environment Variables150294
- Node: Exit Status154246
- Node: Include Files154923
- Node: Loading Shared Libraries158613
- Node: Obsolete160041
- Node: Undocumented160733
- Node: Invoking Summary161030
- Node: Regexp163871
- Node: Regexp Usage165325
- Node: Escape Sequences167362
- Node: Regexp Operators173603
- Node: Regexp Operator Details174088
- Ref: Regexp Operator Details-Footnote-1181452
- Node: Interval Expressions181599
- Ref: Interval Expressions-Footnote-1183020
- Node: Bracket Expressions183118
- Ref: table-char-classes185594
- Node: Leftmost Longest188920
- Node: Computed Regexps190223
- Node: GNU Regexp Operators193650
- Node: Case-sensitivity197387
- Ref: Case-sensitivity-Footnote-1200253
- Ref: Case-sensitivity-Footnote-2200488
- Node: Regexp Summary200596
- Node: Reading Files202062
- Node: Records204331
- Node: awk split records205406
- Node: gawk split records210106
- Ref: gawk split records-Footnote-1215180
- Node: Fields215217
- Node: Nonconstant Fields217958
- Ref: Nonconstant Fields-Footnote-1220194
- Node: Changing Fields220398
- Node: Field Separators226429
- Node: Default Field Splitting229127
- Node: Regexp Field Splitting230245
- Node: Single Character Fields233922
- Node: Command Line Field Separator234982
- Node: Full Line Fields238200
- Ref: Full Line Fields-Footnote-1239722
- Ref: Full Line Fields-Footnote-2239768
- Node: Field Splitting Summary239869
- Node: Constant Size241943
- Node: Fixed width data242675
- Node: Skipping intervening246142
- Node: Allowing trailing data246940
- Node: Fields with fixed data247977
- Node: Splitting By Content249495
- Ref: Splitting By Content-Footnote-1253278
- Node: More CSV253441
- Node: Testing field creation255033
- Node: Multiple Line256658
- Node: Getline262935
- Node: Plain Getline265404
- Node: Getline/Variable267977
- Node: Getline/File269128
- Node: Getline/Variable/File270516
- Ref: Getline/Variable/File-Footnote-1272121
- Node: Getline/Pipe272209
- Node: Getline/Variable/Pipe274913
- Node: Getline/Coprocess276048
- Node: Getline/Variable/Coprocess277315
- Node: Getline Notes278057
- Node: Getline Summary280854
- Ref: table-getline-variants281278
- Node: Read Timeout282026
- Ref: Read Timeout-Footnote-1285932
- Node: Retrying Input285990
- Node: Command-line directories287189
- Node: Input Summary288095
- Node: Input Exercises291267
- Node: Printing291701
- Node: Print293535
- Node: Print Examples294992
- Node: Output Separators297772
- Node: OFMT299789
- Node: Printf301145
- Node: Basic Printf301930
- Node: Control Letters303504
- Node: Format Modifiers308666
- Node: Printf Examples314681
- Node: Redirection317167
- Node: Special FD324008
- Ref: Special FD-Footnote-1327176
- Node: Special Files327250
- Node: Other Inherited Files327867
- Node: Special Network328868
- Node: Special Caveats329728
- Node: Close Files And Pipes330677
- Ref: table-close-pipe-return-values337584
- Ref: Close Files And Pipes-Footnote-1338397
- Ref: Close Files And Pipes-Footnote-2338545
- Node: Nonfatal338697
- Node: Output Summary341035
- Node: Output Exercises342257
- Node: Expressions342936
- Node: Values344124
- Node: Constants344802
- Node: Scalar Constants345493
- Ref: Scalar Constants-Footnote-1348003
- Node: Nondecimal-numbers348253
- Node: Regexp Constants351254
- Node: Using Constant Regexps351780
- Node: Standard Regexp Constants352402
- Node: Strong Regexp Constants355590
- Node: Variables358602
- Node: Using Variables359259
- Node: Assignment Options361169
- Node: Conversion363640
- Node: Strings And Numbers364164
- Ref: Strings And Numbers-Footnote-1367227
- Node: Locale influences conversions367336
- Ref: table-locale-affects370094
- Node: All Operators370712
- Node: Arithmetic Ops371341
- Node: Concatenation374057
- Ref: Concatenation-Footnote-1376904
- Node: Assignment Ops377011
- Ref: table-assign-ops382002
- Node: Increment Ops383315
- Node: Truth Values and Conditions386775
- Node: Truth Values387849
- Node: Typing and Comparison388897
- Node: Variable Typing389717
- Ref: Variable Typing-Footnote-1396180
- Ref: Variable Typing-Footnote-2396252
- Node: Comparison Operators396329
- Ref: table-relational-ops396748
- Node: POSIX String Comparison400243
- Ref: POSIX String Comparison-Footnote-1401938
- Ref: POSIX String Comparison-Footnote-2402077
- Node: Boolean Ops402161
- Ref: Boolean Ops-Footnote-1406643
- Node: Conditional Exp406735
- Node: Function Calls408471
- Node: Precedence412348
- Node: Locales416007
- Node: Expressions Summary417639
- Node: Patterns and Actions420212
- Node: Pattern Overview421332
- Node: Regexp Patterns423009
- Node: Expression Patterns423551
- Node: Ranges427332
- Node: BEGIN/END430440
- Node: Using BEGIN/END431201
- Ref: Using BEGIN/END-Footnote-1433955
- Node: I/O And BEGIN/END434061
- Node: BEGINFILE/ENDFILE436374
- Node: Empty439605
- Node: Using Shell Variables439922
- Node: Action Overview442196
- Node: Statements444521
- Node: If Statement446369
- Node: While Statement447864
- Node: Do Statement449892
- Node: For Statement451040
- Node: Switch Statement454211
- Node: Break Statement456652
- Node: Continue Statement458744
- Node: Next Statement460571
- Node: Nextfile Statement462954
- Node: Exit Statement465643
- Node: Built-in Variables468046
- Node: User-modified469179
- Node: Auto-set476946
- Ref: Auto-set-Footnote-1493753
- Ref: Auto-set-Footnote-2493959
- Node: ARGC and ARGV494015
- Node: Pattern Action Summary498228
- Node: Arrays500658
- Node: Array Basics501987
- Node: Array Intro502831
- Ref: figure-array-elements504806
- Ref: Array Intro-Footnote-1507510
- Node: Reference to Elements507638
- Node: Assigning Elements510102
- Node: Array Example510593
- Node: Scanning an Array512352
- Node: Controlling Scanning515374
- Ref: Controlling Scanning-Footnote-1521830
- Node: Numeric Array Subscripts522146
- Node: Uninitialized Subscripts524330
- Node: Delete525949
- Ref: Delete-Footnote-1528701
- Node: Multidimensional528758
- Node: Multiscanning531853
- Node: Arrays of Arrays533444
- Node: Arrays Summary538212
- Node: Functions540305
- Node: Built-in541343
- Node: Calling Built-in542424
- Node: Numeric Functions544420
- Ref: Numeric Functions-Footnote-1548446
- Ref: Numeric Functions-Footnote-2549094
- Ref: Numeric Functions-Footnote-3549142
- Node: String Functions549414
- Ref: String Functions-Footnote-1573555
- Ref: String Functions-Footnote-2573683
- Ref: String Functions-Footnote-3573931
- Node: Gory Details574018
- Ref: table-sub-escapes575809
- Ref: table-sub-proposed577328
- Ref: table-posix-sub578691
- Ref: table-gensub-escapes580232
- Ref: Gory Details-Footnote-1581055
- Node: I/O Functions581209
- Ref: table-system-return-values587663
- Ref: I/O Functions-Footnote-1589743
- Ref: I/O Functions-Footnote-2589891
- Node: Time Functions590011
- Ref: Time Functions-Footnote-1600682
- Ref: Time Functions-Footnote-2600750
- Ref: Time Functions-Footnote-3600908
- Ref: Time Functions-Footnote-4601019
- Ref: Time Functions-Footnote-5601131
- Ref: Time Functions-Footnote-6601358
- Node: Bitwise Functions601624
- Ref: table-bitwise-ops602218
- Ref: Bitwise Functions-Footnote-1608281
- Ref: Bitwise Functions-Footnote-2608454
- Node: Type Functions608645
- Node: I18N Functions611508
- Node: User-defined613159
- Node: Definition Syntax613971
- Ref: Definition Syntax-Footnote-1619665
- Node: Function Example619736
- Ref: Function Example-Footnote-1622658
- Node: Function Calling622680
- Node: Calling A Function623268
- Node: Variable Scope624226
- Node: Pass By Value/Reference627220
- Node: Function Caveats629864
- Ref: Function Caveats-Footnote-1631911
- Node: Return Statement632031
- Node: Dynamic Typing635010
- Node: Indirect Calls635940
- Ref: Indirect Calls-Footnote-1646192
- Node: Functions Summary646320
- Node: Library Functions649025
- Ref: Library Functions-Footnote-1652632
- Ref: Library Functions-Footnote-2652775
- Node: Library Names652946
- Ref: Library Names-Footnote-1656613
- Ref: Library Names-Footnote-2656836
- Node: General Functions656922
- Node: Strtonum Function658025
- Node: Assert Function661047
- Node: Round Function664373
- Node: Cliff Random Function665913
- Node: Ordinal Functions666929
- Ref: Ordinal Functions-Footnote-1669992
- Ref: Ordinal Functions-Footnote-2670244
- Node: Join Function670454
- Ref: Join Function-Footnote-1672224
- Node: Getlocaltime Function672424
- Node: Readfile Function676166
- Node: Shell Quoting678143
- Node: Data File Management679544
- Node: Filetrans Function680176
- Node: Rewind Function684272
- Node: File Checking686181
- Ref: File Checking-Footnote-1687515
- Node: Empty Files687716
- Node: Ignoring Assigns689695
- Node: Getopt Function691245
- Ref: Getopt Function-Footnote-1706456
- Node: Passwd Functions706656
- Ref: Passwd Functions-Footnote-1715495
- Node: Group Functions715583
- Ref: Group Functions-Footnote-1723481
- Node: Walking Arrays723688
- Node: Library Functions Summary726696
- Node: Library Exercises728102
- Node: Sample Programs728567
- Node: Running Examples729337
- Node: Clones730065
- Node: Cut Program731289
- Node: Egrep Program741429
- Node: Id Program750430
- Node: Split Program760377
- Ref: Split Program-Footnote-1770267
- Node: Tee Program770440
- Node: Uniq Program773230
- Node: Wc Program780818
- Node: Bytes vs. Characters781215
- Node: Using extensions782763
- Node: wc program783517
- Node: Miscellaneous Programs788382
- Node: Dupword Program789595
- Node: Alarm Program791625
- Node: Translate Program796480
- Ref: Translate Program-Footnote-1801045
- Node: Labels Program801315
- Ref: Labels Program-Footnote-1804666
- Node: Word Sorting804750
- Node: History Sorting808822
- Node: Extract Program811047
- Node: Simple Sed819101
- Node: Igawk Program822175
- Ref: Igawk Program-Footnote-1836506
- Ref: Igawk Program-Footnote-2836708
- Ref: Igawk Program-Footnote-3836830
- Node: Anagram Program836945
- Node: Signature Program840007
- Node: Programs Summary841254
- Node: Programs Exercises842468
- Ref: Programs Exercises-Footnote-1846598
- Node: Advanced Features846684
- Node: Nondecimal Data848751
- Node: Array Sorting850342
- Node: Controlling Array Traversal851042
- Ref: Controlling Array Traversal-Footnote-1859410
- Node: Array Sorting Functions859528
- Ref: Array Sorting Functions-Footnote-1864619
- Node: Two-way I/O864815
- Ref: Two-way I/O-Footnote-1872536
- Ref: Two-way I/O-Footnote-2872723
- Node: TCP/IP Networking872805
- Node: Profiling875923
- Node: Extension Philosophy885232
- Node: Advanced Features Summary886711
- Node: Internationalization888726
- Node: I18N and L10N890206
- Node: Explaining gettext890893
- Ref: Explaining gettext-Footnote-1896785
- Ref: Explaining gettext-Footnote-2896970
- Node: Programmer i18n897135
- Ref: Programmer i18n-Footnote-1902084
- Node: Translator i18n902133
- Node: String Extraction902927
- Ref: String Extraction-Footnote-1904059
- Node: Printf Ordering904145
- Ref: Printf Ordering-Footnote-1906931
- Node: I18N Portability906995
- Ref: I18N Portability-Footnote-1909451
- Node: I18N Example909514
- Ref: I18N Example-Footnote-1912789
- Ref: I18N Example-Footnote-2912862
- Node: Gawk I18N912971
- Node: I18N Summary913620
- Node: Debugger914961
- Node: Debugging915961
- Node: Debugging Concepts916402
- Node: Debugging Terms918211
- Node: Awk Debugging920786
- Ref: Awk Debugging-Footnote-1921731
- Node: Sample Debugging Session921863
- Node: Debugger Invocation922397
- Node: Finding The Bug923783
- Node: List of Debugger Commands930257
- Node: Breakpoint Control931590
- Node: Debugger Execution Control935284
- Node: Viewing And Changing Data938646
- Node: Execution Stack942187
- Node: Debugger Info943824
- Node: Miscellaneous Debugger Commands947895
- Node: Readline Support952957
- Node: Limitations953853
- Node: Debugging Summary956407
- Node: Namespaces957686
- Node: Global Namespace958797
- Node: Qualified Names960195
- Node: Default Namespace961194
- Node: Changing The Namespace961935
- Node: Naming Rules963549
- Node: Internal Name Management965397
- Node: Namespace Example966439
- Node: Namespace And Features969001
- Node: Namespace Summary970436
- Node: Arbitrary Precision Arithmetic971913
- Node: Computer Arithmetic973400
- Ref: table-numeric-ranges977166
- Ref: table-floating-point-ranges977659
- Ref: Computer Arithmetic-Footnote-1978317
- Node: Math Definitions978374
- Ref: table-ieee-formats981350
- Node: MPFR features981917
- Node: FP Math Caution983635
- Ref: FP Math Caution-Footnote-1984707
- Node: Inexactness of computations985076
- Node: Inexact representation986107
- Node: Comparing FP Values987467
- Node: Errors accumulate988708
- Node: Strange values990164
- Ref: Strange values-Footnote-1992752
- Node: Getting Accuracy992857
- Node: Try To Round995567
- Node: Setting precision996466
- Ref: table-predefined-precision-strings997163
- Node: Setting the rounding mode998993
- Ref: table-gawk-rounding-modes999367
- Ref: Setting the rounding mode-Footnote-11003298
- Node: Arbitrary Precision Integers1003477
- Ref: Arbitrary Precision Integers-Footnote-11006652
- Node: Checking for MPFR1006801
- Node: POSIX Floating Point Problems1008275
- Ref: POSIX Floating Point Problems-Footnote-11012560
- Node: Floating point summary1012598
- Node: Dynamic Extensions1014788
- Node: Extension Intro1016341
- Node: Plugin License1017607
- Node: Extension Mechanism Outline1018404
- Ref: figure-load-extension1018843
- Ref: figure-register-new-function1020408
- Ref: figure-call-new-function1021500
- Node: Extension API Description1023562
- Node: Extension API Functions Introduction1025275
- Ref: table-api-std-headers1027111
- Node: General Data Types1031360
- Ref: General Data Types-Footnote-11040066
- Node: Memory Allocation Functions1040365
- Ref: Memory Allocation Functions-Footnote-11044866
- Node: Constructor Functions1044965
- Node: API Ownership of MPFR and GMP Values1048618
- Node: Registration Functions1049931
- Node: Extension Functions1050631
- Node: Exit Callback Functions1055953
- Node: Extension Version String1057203
- Node: Input Parsers1057866
- Node: Output Wrappers1070587
- Node: Two-way processors1075099
- Node: Printing Messages1077364
- Ref: Printing Messages-Footnote-11078535
- Node: Updating ERRNO1078688
- Node: Requesting Values1079427
- Ref: table-value-types-returned1080164
- Node: Accessing Parameters1081272
- Node: Symbol Table Access1082509
- Node: Symbol table by name1083021
- Ref: Symbol table by name-Footnote-11086045
- Node: Symbol table by cookie1086173
- Ref: Symbol table by cookie-Footnote-11090358
- Node: Cached values1090422
- Ref: Cached values-Footnote-11093958
- Node: Array Manipulation1094111
- Ref: Array Manipulation-Footnote-11095202
- Node: Array Data Types1095239
- Ref: Array Data Types-Footnote-11097897
- Node: Array Functions1097989
- Node: Flattening Arrays1102487
- Node: Creating Arrays1109463
- Node: Redirection API1114230
- Node: Extension API Variables1117063
- Node: Extension Versioning1117774
- Ref: gawk-api-version1118203
- Node: Extension GMP/MPFR Versioning1119934
- Node: Extension API Informational Variables1121562
- Node: Extension API Boilerplate1122635
- Node: Changes from API V11126609
- Node: Finding Extensions1128181
- Node: Extension Example1128740
- Node: Internal File Description1129538
- Node: Internal File Ops1133618
- Ref: Internal File Ops-Footnote-11144968
- Node: Using Internal File Ops1145108
- Ref: Using Internal File Ops-Footnote-11147491
- Node: Extension Samples1147765
- Node: Extension Sample File Functions1149294
- Node: Extension Sample Fnmatch1156943
- Node: Extension Sample Fork1158430
- Node: Extension Sample Inplace1159648
- Node: Extension Sample Ord1163274
- Node: Extension Sample Readdir1164110
- Ref: table-readdir-file-types1164999
- Node: Extension Sample Revout1166066
- Node: Extension Sample Rev2way1166655
- Node: Extension Sample Read write array1167395
- Node: Extension Sample Readfile1169337
- Node: Extension Sample Time1170432
- Node: Extension Sample API Tests1172184
- Node: gawkextlib1172676
- Node: Extension summary1175594
- Node: Extension Exercises1179296
- Node: Language History1180538
- Node: V7/SVR3.11182194
- Node: SVR41184346
- Node: POSIX1185780
- Node: BTL1187161
- Node: POSIX/GNU1187890
- Node: Feature History1193668
- Node: Common Extensions1209987
- Node: Ranges and Locales1211270
- Ref: Ranges and Locales-Footnote-11215886
- Ref: Ranges and Locales-Footnote-21215913
- Ref: Ranges and Locales-Footnote-31216148
- Node: Contributors1216371
- Node: History summary1222368
- Node: Installation1223748
- Node: Gawk Distribution1224692
- Node: Getting1225176
- Node: Extracting1226139
- Node: Distribution contents1227777
- Node: Unix Installation1234257
- Node: Quick Installation1234939
- Node: Shell Startup Files1237353
- Node: Additional Configuration Options1238442
- Node: Configuration Philosophy1240757
- Node: Non-Unix Installation1243126
- Node: PC Installation1243586
- Node: PC Binary Installation1244424
- Node: PC Compiling1244859
- Node: PC Using1245976
- Node: Cygwin1249529
- Node: MSYS1250753
- Node: VMS Installation1251355
- Node: VMS Compilation1252146
- Ref: VMS Compilation-Footnote-11253375
- Node: VMS Dynamic Extensions1253433
- Node: VMS Installation Details1255118
- Node: VMS Running1257371
- Node: VMS GNV1261650
- Node: VMS Old Gawk1262385
- Node: Bugs1262856
- Node: Bug address1263519
- Node: Usenet1266501
- Node: Maintainers1267505
- Node: Other Versions1268690
- Node: Installation summary1276555
- Node: Notes1277764
- Node: Compatibility Mode1278558
- Node: Additions1279340
- Node: Accessing The Source1280265
- Node: Adding Code1281702
- Node: New Ports1287921
- Node: Derived Files1292296
- Ref: Derived Files-Footnote-11297956
- Ref: Derived Files-Footnote-21297991
- Ref: Derived Files-Footnote-31298589
- Node: Future Extensions1298703
- Node: Implementation Limitations1299361
- Node: Extension Design1300571
- Node: Old Extension Problems1301715
- Ref: Old Extension Problems-Footnote-11303233
- Node: Extension New Mechanism Goals1303290
- Ref: Extension New Mechanism Goals-Footnote-11306654
- Node: Extension Other Design Decisions1306843
- Node: Extension Future Growth1308956
- Node: Notes summary1309562
- Node: Basic Concepts1310720
- Node: Basic High Level1311401
- Ref: figure-general-flow1311683
- Ref: figure-process-flow1312368
- Ref: Basic High Level-Footnote-11315669
- Node: Basic Data Typing1315854
- Node: Glossary1319182
- Node: Copying1351067
- Node: GNU Free Documentation License1388610
- Node: Index1413730
+ Node: Foreword344859
+ Node: Foreword449301
+ Node: Preface50833
+ Ref: Preface-Footnote-153692
+ Ref: Preface-Footnote-253801
+ Ref: Preface-Footnote-354035
+ Node: History54177
+ Node: Names56529
+ Ref: Names-Footnote-157633
+ Node: This Manual57780
+ Ref: This Manual-Footnote-164419
+ Node: Conventions64519
+ Node: Manual History66888
+ Ref: Manual History-Footnote-169885
+ Ref: Manual History-Footnote-269926
+ Node: How To Contribute70000
+ Node: Acknowledgments70926
+ Node: Getting Started75863
+ Node: Running gawk78302
+ Node: One-shot79492
+ Node: Read Terminal80755
+ Node: Long82748
+ Node: Executable Scripts84261
+ Ref: Executable Scripts-Footnote-186894
+ Node: Comments86997
+ Node: Quoting89481
+ Node: DOS Quoting95007
+ Node: Sample Data Files97063
+ Node: Very Simple99658
+ Node: Two Rules105760
+ Node: More Complex107645
+ Node: Statements/Lines109977
+ Ref: Statements/Lines-Footnote-1114461
+ Node: Other Features114726
+ Node: When115662
+ Ref: When-Footnote-1117416
+ Node: Intro Summary117481
+ Node: Invoking Gawk118365
+ Node: Command Line119879
+ Node: Options120677
+ Ref: Options-Footnote-1138591
+ Ref: Options-Footnote-2138822
+ Node: Other Arguments138847
+ Node: Naming Standard Input142858
+ Node: Environment Variables144068
+ Node: AWKPATH Variable144626
+ Ref: AWKPATH Variable-Footnote-1148038
+ Ref: AWKPATH Variable-Footnote-2148072
+ Node: AWKLIBPATH Variable148443
+ Ref: AWKLIBPATH Variable-Footnote-1150140
+ Node: Other Environment Variables150515
+ Node: Exit Status154467
+ Node: Include Files155144
+ Node: Loading Shared Libraries158834
+ Node: Obsolete160262
+ Node: Undocumented160954
+ Node: Invoking Summary161251
+ Node: Regexp164092
+ Node: Regexp Usage165546
+ Node: Escape Sequences167583
+ Node: Regexp Operators173824
+ Node: Regexp Operator Details174309
+ Ref: Regexp Operator Details-Footnote-1181673
+ Node: Interval Expressions181820
+ Ref: Interval Expressions-Footnote-1183241
+ Node: Bracket Expressions183339
+ Ref: table-char-classes185815
+ Node: Leftmost Longest189141
+ Node: Computed Regexps190444
+ Node: GNU Regexp Operators193871
+ Node: Case-sensitivity197608
+ Ref: Case-sensitivity-Footnote-1200474
+ Ref: Case-sensitivity-Footnote-2200709
+ Node: Regexp Summary200817
+ Node: Reading Files202283
+ Node: Records204552
+ Node: awk split records205627
+ Node: gawk split records210327
+ Ref: gawk split records-Footnote-1215401
+ Node: Fields215438
+ Node: Nonconstant Fields218179
+ Ref: Nonconstant Fields-Footnote-1220415
+ Node: Changing Fields220619
+ Node: Field Separators226650
+ Node: Default Field Splitting229348
+ Node: Regexp Field Splitting230466
+ Node: Single Character Fields234143
+ Node: Command Line Field Separator235203
+ Node: Full Line Fields238421
+ Ref: Full Line Fields-Footnote-1239943
+ Ref: Full Line Fields-Footnote-2239989
+ Node: Field Splitting Summary240090
+ Node: Constant Size242164
+ Node: Fixed width data242896
+ Node: Skipping intervening246363
+ Node: Allowing trailing data247161
+ Node: Fields with fixed data248198
+ Node: Splitting By Content249716
+ Ref: Splitting By Content-Footnote-1253499
+ Node: More CSV253662
+ Node: Testing field creation255254
+ Node: Multiple Line256879
+ Node: Getline263156
+ Node: Plain Getline265625
+ Node: Getline/Variable268198
+ Node: Getline/File269349
+ Node: Getline/Variable/File270737
+ Ref: Getline/Variable/File-Footnote-1272342
+ Node: Getline/Pipe272430
+ Node: Getline/Variable/Pipe275134
+ Node: Getline/Coprocess276269
+ Node: Getline/Variable/Coprocess277536
+ Node: Getline Notes278278
+ Node: Getline Summary281075
+ Ref: table-getline-variants281499
+ Node: Read Timeout282247
+ Ref: Read Timeout-Footnote-1286153
+ Node: Retrying Input286211
+ Node: Command-line directories287410
+ Node: Input Summary288316
+ Node: Input Exercises291488
+ Node: Printing291922
+ Node: Print293756
+ Node: Print Examples295213
+ Node: Output Separators297993
+ Node: OFMT300010
+ Node: Printf301366
+ Node: Basic Printf302151
+ Node: Control Letters303725
+ Node: Format Modifiers308887
+ Node: Printf Examples314902
+ Node: Redirection317388
+ Node: Special FD324229
+ Ref: Special FD-Footnote-1327397
+ Node: Special Files327471
+ Node: Other Inherited Files328088
+ Node: Special Network329089
+ Node: Special Caveats329949
+ Node: Close Files And Pipes330898
+ Ref: table-close-pipe-return-values337805
+ Ref: Close Files And Pipes-Footnote-1338618
+ Ref: Close Files And Pipes-Footnote-2338766
+ Node: Nonfatal338918
+ Node: Output Summary341256
+ Node: Output Exercises342478
+ Node: Expressions343157
+ Node: Values344345
+ Node: Constants345023
+ Node: Scalar Constants345714
+ Ref: Scalar Constants-Footnote-1348224
+ Node: Nondecimal-numbers348474
+ Node: Regexp Constants351475
+ Node: Using Constant Regexps352001
+ Node: Standard Regexp Constants352623
+ Node: Strong Regexp Constants355811
+ Node: Variables358823
+ Node: Using Variables359480
+ Node: Assignment Options361390
+ Node: Conversion363861
+ Node: Strings And Numbers364385
+ Ref: Strings And Numbers-Footnote-1367448
+ Node: Locale influences conversions367557
+ Ref: table-locale-affects370315
+ Node: All Operators370933
+ Node: Arithmetic Ops371562
+ Node: Concatenation374278
+ Ref: Concatenation-Footnote-1377125
+ Node: Assignment Ops377232
+ Ref: table-assign-ops382223
+ Node: Increment Ops383536
+ Node: Truth Values and Conditions386996
+ Node: Truth Values388070
+ Node: Typing and Comparison389118
+ Node: Variable Typing389938
+ Ref: Variable Typing-Footnote-1396401
+ Ref: Variable Typing-Footnote-2396473
+ Node: Comparison Operators396550
+ Ref: table-relational-ops396969
+ Node: POSIX String Comparison400464
+ Ref: POSIX String Comparison-Footnote-1402159
+ Ref: POSIX String Comparison-Footnote-2402298
+ Node: Boolean Ops402382
+ Ref: Boolean Ops-Footnote-1406864
+ Node: Conditional Exp406956
+ Node: Function Calls408692
+ Node: Precedence412569
+ Node: Locales416228
+ Node: Expressions Summary417860
+ Node: Patterns and Actions420433
+ Node: Pattern Overview421553
+ Node: Regexp Patterns423230
+ Node: Expression Patterns423772
+ Node: Ranges427553
+ Node: BEGIN/END430661
+ Node: Using BEGIN/END431422
+ Ref: Using BEGIN/END-Footnote-1434176
+ Node: I/O And BEGIN/END434282
+ Node: BEGINFILE/ENDFILE436595
+ Node: Empty439826
+ Node: Using Shell Variables440143
+ Node: Action Overview442417
+ Node: Statements444742
+ Node: If Statement446590
+ Node: While Statement448085
+ Node: Do Statement450113
+ Node: For Statement451261
+ Node: Switch Statement454432
+ Node: Break Statement456873
+ Node: Continue Statement458965
+ Node: Next Statement460792
+ Node: Nextfile Statement463175
+ Node: Exit Statement465864
+ Node: Built-in Variables468267
+ Node: User-modified469400
+ Node: Auto-set477167
+ Ref: Auto-set-Footnote-1493974
+ Ref: Auto-set-Footnote-2494180
+ Node: ARGC and ARGV494236
+ Node: Pattern Action Summary498449
+ Node: Arrays500879
+ Node: Array Basics502208
+ Node: Array Intro503052
+ Ref: figure-array-elements505027
+ Ref: Array Intro-Footnote-1507731
+ Node: Reference to Elements507859
+ Node: Assigning Elements510323
+ Node: Array Example510814
+ Node: Scanning an Array512573
+ Node: Controlling Scanning515595
+ Ref: Controlling Scanning-Footnote-1522051
+ Node: Numeric Array Subscripts522367
+ Node: Uninitialized Subscripts524551
+ Node: Delete526170
+ Ref: Delete-Footnote-1528922
+ Node: Multidimensional528979
+ Node: Multiscanning532074
+ Node: Arrays of Arrays533665
+ Node: Arrays Summary538433
+ Node: Functions540526
+ Node: Built-in541564
+ Node: Calling Built-in542645
+ Node: Numeric Functions544641
+ Ref: Numeric Functions-Footnote-1548667
+ Ref: Numeric Functions-Footnote-2549315
+ Ref: Numeric Functions-Footnote-3549363
+ Node: String Functions549635
+ Ref: String Functions-Footnote-1573776
+ Ref: String Functions-Footnote-2573904
+ Ref: String Functions-Footnote-3574152
+ Node: Gory Details574239
+ Ref: table-sub-escapes576030
+ Ref: table-sub-proposed577549
+ Ref: table-posix-sub578912
+ Ref: table-gensub-escapes580453
+ Ref: Gory Details-Footnote-1581276
+ Node: I/O Functions581430
+ Ref: table-system-return-values587884
+ Ref: I/O Functions-Footnote-1589964
+ Ref: I/O Functions-Footnote-2590112
+ Node: Time Functions590232
+ Ref: Time Functions-Footnote-1600903
+ Ref: Time Functions-Footnote-2600971
+ Ref: Time Functions-Footnote-3601129
+ Ref: Time Functions-Footnote-4601240
+ Ref: Time Functions-Footnote-5601352
+ Ref: Time Functions-Footnote-6601579
+ Node: Bitwise Functions601845
+ Ref: table-bitwise-ops602439
+ Ref: Bitwise Functions-Footnote-1608502
+ Ref: Bitwise Functions-Footnote-2608675
+ Node: Type Functions608866
+ Node: I18N Functions611729
+ Node: User-defined613380
+ Node: Definition Syntax614192
+ Ref: Definition Syntax-Footnote-1619886
+ Node: Function Example619957
+ Ref: Function Example-Footnote-1622879
+ Node: Function Calling622901
+ Node: Calling A Function623489
+ Node: Variable Scope624447
+ Node: Pass By Value/Reference627441
+ Node: Function Caveats630085
+ Ref: Function Caveats-Footnote-1632132
+ Node: Return Statement632252
+ Node: Dynamic Typing635231
+ Node: Indirect Calls636161
+ Ref: Indirect Calls-Footnote-1646413
+ Node: Functions Summary646541
+ Node: Library Functions649246
+ Ref: Library Functions-Footnote-1652853
+ Ref: Library Functions-Footnote-2652996
+ Node: Library Names653167
+ Ref: Library Names-Footnote-1656834
+ Ref: Library Names-Footnote-2657057
+ Node: General Functions657143
+ Node: Strtonum Function658246
+ Node: Assert Function661268
+ Node: Round Function664594
+ Node: Cliff Random Function666134
+ Node: Ordinal Functions667150
+ Ref: Ordinal Functions-Footnote-1670213
+ Ref: Ordinal Functions-Footnote-2670465
+ Node: Join Function670675
+ Ref: Join Function-Footnote-1672445
+ Node: Getlocaltime Function672645
+ Node: Readfile Function676387
+ Node: Shell Quoting678364
+ Node: Data File Management679765
+ Node: Filetrans Function680397
+ Node: Rewind Function684493
+ Node: File Checking686402
+ Ref: File Checking-Footnote-1687736
+ Node: Empty Files687937
+ Node: Ignoring Assigns689916
+ Node: Getopt Function691466
+ Ref: Getopt Function-Footnote-1706677
+ Node: Passwd Functions706877
+ Ref: Passwd Functions-Footnote-1715716
+ Node: Group Functions715804
+ Ref: Group Functions-Footnote-1723702
+ Node: Walking Arrays723909
+ Node: Library Functions Summary726917
+ Node: Library Exercises728323
+ Node: Sample Programs728788
+ Node: Running Examples729558
+ Node: Clones730286
+ Node: Cut Program731510
+ Node: Egrep Program741650
+ Node: Id Program750651
+ Node: Split Program760598
+ Ref: Split Program-Footnote-1770488
+ Node: Tee Program770661
+ Node: Uniq Program773451
+ Node: Wc Program781039
+ Node: Bytes vs. Characters781426
+ Node: Using extensions782974
+ Node: wc program783728
+ Node: Miscellaneous Programs788593
+ Node: Dupword Program789806
+ Node: Alarm Program791836
+ Node: Translate Program796691
+ Ref: Translate Program-Footnote-1801256
+ Node: Labels Program801526
+ Ref: Labels Program-Footnote-1804877
+ Node: Word Sorting804961
+ Node: History Sorting809033
+ Node: Extract Program811258
+ Node: Simple Sed819312
+ Node: Igawk Program822386
+ Ref: Igawk Program-Footnote-1836717
+ Ref: Igawk Program-Footnote-2836919
+ Ref: Igawk Program-Footnote-3837041
+ Node: Anagram Program837156
+ Node: Signature Program840218
+ Node: Programs Summary841465
+ Node: Programs Exercises842679
+ Ref: Programs Exercises-Footnote-1846809
+ Node: Advanced Features846895
+ Node: Nondecimal Data848962
+ Node: Array Sorting850553
+ Node: Controlling Array Traversal851253
+ Ref: Controlling Array Traversal-Footnote-1859621
+ Node: Array Sorting Functions859739
+ Ref: Array Sorting Functions-Footnote-1864830
+ Node: Two-way I/O865026
+ Ref: Two-way I/O-Footnote-1872747
+ Ref: Two-way I/O-Footnote-2872934
+ Node: TCP/IP Networking873016
+ Node: Profiling876134
+ Node: Extension Philosophy885443
+ Node: Advanced Features Summary886922
+ Node: Internationalization888937
+ Node: I18N and L10N890417
+ Node: Explaining gettext891104
+ Ref: Explaining gettext-Footnote-1896996
+ Ref: Explaining gettext-Footnote-2897181
+ Node: Programmer i18n897346
+ Ref: Programmer i18n-Footnote-1902295
+ Node: Translator i18n902344
+ Node: String Extraction903138
+ Ref: String Extraction-Footnote-1904270
+ Node: Printf Ordering904356
+ Ref: Printf Ordering-Footnote-1907142
+ Node: I18N Portability907206
+ Ref: I18N Portability-Footnote-1909662
+ Node: I18N Example909725
+ Ref: I18N Example-Footnote-1913000
+ Ref: I18N Example-Footnote-2913073
+ Node: Gawk I18N913182
+ Node: I18N Summary913831
+ Node: Debugger915172
+ Node: Debugging916172
+ Node: Debugging Concepts916613
+ Node: Debugging Terms918422
+ Node: Awk Debugging920997
+ Ref: Awk Debugging-Footnote-1921942
+ Node: Sample Debugging Session922074
+ Node: Debugger Invocation922608
+ Node: Finding The Bug923994
+ Node: List of Debugger Commands930468
+ Node: Breakpoint Control931801
+ Node: Debugger Execution Control935495
+ Node: Viewing And Changing Data938857
+ Node: Execution Stack942398
+ Node: Debugger Info944035
+ Node: Miscellaneous Debugger Commands948106
+ Node: Readline Support953168
+ Node: Limitations954064
+ Node: Debugging Summary956618
+ Node: Namespaces957897
+ Node: Global Namespace959008
+ Node: Qualified Names960406
+ Node: Default Namespace961405
+ Node: Changing The Namespace962146
+ Node: Naming Rules963760
+ Node: Internal Name Management965608
+ Node: Namespace Example966650
+ Node: Namespace And Features969212
+ Node: Namespace Summary970647
+ Node: Arbitrary Precision Arithmetic972124
+ Node: Computer Arithmetic973611
+ Ref: table-numeric-ranges977377
+ Ref: table-floating-point-ranges977870
+ Ref: Computer Arithmetic-Footnote-1978528
+ Node: Math Definitions978585
+ Ref: table-ieee-formats981561
+ Node: MPFR features982128
+ Node: FP Math Caution983846
+ Ref: FP Math Caution-Footnote-1984918
+ Node: Inexactness of computations985287
+ Node: Inexact representation986318
+ Node: Comparing FP Values987678
+ Node: Errors accumulate988919
+ Node: Strange values990375
+ Ref: Strange values-Footnote-1992963
+ Node: Getting Accuracy993068
+ Node: Try To Round995778
+ Node: Setting precision996677
+ Ref: table-predefined-precision-strings997374
+ Node: Setting the rounding mode999204
+ Ref: table-gawk-rounding-modes999578
+ Ref: Setting the rounding mode-Footnote-11003509
+ Node: Arbitrary Precision Integers1003688
+ Ref: Arbitrary Precision Integers-Footnote-11006863
+ Node: Checking for MPFR1007012
+ Node: POSIX Floating Point Problems1008486
+ Ref: POSIX Floating Point Problems-Footnote-11012771
+ Node: Floating point summary1012809
+ Node: Dynamic Extensions1014999
+ Node: Extension Intro1016552
+ Node: Plugin License1017818
+ Node: Extension Mechanism Outline1018615
+ Ref: figure-load-extension1019054
+ Ref: figure-register-new-function1020619
+ Ref: figure-call-new-function1021711
+ Node: Extension API Description1023773
+ Node: Extension API Functions Introduction1025486
+ Ref: table-api-std-headers1027322
+ Node: General Data Types1031571
-Ref: General Data Types-Footnote-11040201
-Node: Memory Allocation Functions1040500
-Ref: Memory Allocation Functions-Footnote-11045001
-Node: Constructor Functions1045100
-Node: API Ownership of MPFR and GMP Values1048566
-Node: Registration Functions1049879
-Node: Extension Functions1050579
-Node: Exit Callback Functions1055901
-Node: Extension Version String1057151
-Node: Input Parsers1057814
-Node: Output Wrappers1070535
-Node: Two-way processors1075047
-Node: Printing Messages1077312
-Ref: Printing Messages-Footnote-11078483
-Node: Updating ERRNO1078636
-Node: Requesting Values1079375
-Ref: table-value-types-returned1080112
-Node: Accessing Parameters1081048
-Node: Symbol Table Access1082285
-Node: Symbol table by name1082797
-Ref: Symbol table by name-Footnote-11085821
-Node: Symbol table by cookie1085949
-Ref: Symbol table by cookie-Footnote-11090134
-Node: Cached values1090198
-Ref: Cached values-Footnote-11093734
-Node: Array Manipulation1093887
-Ref: Array Manipulation-Footnote-11094978
-Node: Array Data Types1095015
-Ref: Array Data Types-Footnote-11097673
-Node: Array Functions1097765
-Node: Flattening Arrays1102263
-Node: Creating Arrays1109239
-Node: Redirection API1114006
-Node: Extension API Variables1116839
-Node: Extension Versioning1117550
-Ref: gawk-api-version1117979
-Node: Extension GMP/MPFR Versioning1119710
-Node: Extension API Informational Variables1121338
-Node: Extension API Boilerplate1122411
-Node: Changes from API V11126385
-Node: Finding Extensions1127957
-Node: Extension Example1128516
-Node: Internal File Description1129314
-Node: Internal File Ops1133394
-Ref: Internal File Ops-Footnote-11144744
-Node: Using Internal File Ops1144884
-Ref: Using Internal File Ops-Footnote-11147267
-Node: Extension Samples1147541
-Node: Extension Sample File Functions1149070
-Node: Extension Sample Fnmatch1156719
-Node: Extension Sample Fork1158206
-Node: Extension Sample Inplace1159424
-Node: Extension Sample Ord1163050
-Node: Extension Sample Readdir1163886
-Ref: table-readdir-file-types1164775
-Node: Extension Sample Revout1165842
-Node: Extension Sample Rev2way1166431
-Node: Extension Sample Read write array1167171
-Node: Extension Sample Readfile1169113
-Node: Extension Sample Time1170208
-Node: Extension Sample API Tests1171960
-Node: gawkextlib1172452
-Node: Extension summary1175370
-Node: Extension Exercises1179072
-Node: Language History1180314
-Node: V7/SVR3.11181970
-Node: SVR41184122
-Node: POSIX1185556
-Node: BTL1186937
-Node: POSIX/GNU1187666
-Node: Feature History1193444
-Node: Common Extensions1209763
-Node: Ranges and Locales1211046
-Ref: Ranges and Locales-Footnote-11215662
-Ref: Ranges and Locales-Footnote-21215689
-Ref: Ranges and Locales-Footnote-31215924
-Node: Contributors1216147
-Node: History summary1222144
-Node: Installation1223524
-Node: Gawk Distribution1224468
-Node: Getting1224952
-Node: Extracting1225915
-Node: Distribution contents1227553
-Node: Unix Installation1234033
-Node: Quick Installation1234715
-Node: Shell Startup Files1237129
-Node: Additional Configuration Options1238218
-Node: Configuration Philosophy1240533
-Node: Non-Unix Installation1242902
-Node: PC Installation1243362
-Node: PC Binary Installation1244200
-Node: PC Compiling1244635
-Node: PC Using1245752
-Node: Cygwin1249305
-Node: MSYS1250529
-Node: VMS Installation1251131
-Node: VMS Compilation1251922
-Ref: VMS Compilation-Footnote-11253151
-Node: VMS Dynamic Extensions1253209
-Node: VMS Installation Details1254894
-Node: VMS Running1257147
-Node: VMS GNV1261426
-Node: VMS Old Gawk1262161
-Node: Bugs1262632
-Node: Bug address1263295
-Node: Usenet1266277
-Node: Maintainers1267281
-Node: Other Versions1268466
-Node: Installation summary1276331
-Node: Notes1277540
-Node: Compatibility Mode1278334
-Node: Additions1279116
-Node: Accessing The Source1280041
-Node: Adding Code1281478
-Node: New Ports1287697
-Node: Derived Files1292072
-Ref: Derived Files-Footnote-11297732
-Ref: Derived Files-Footnote-21297767
-Ref: Derived Files-Footnote-31298365
-Node: Future Extensions1298479
-Node: Implementation Limitations1299137
-Node: Extension Design1300347
-Node: Old Extension Problems1301491
-Ref: Old Extension Problems-Footnote-11303009
-Node: Extension New Mechanism Goals1303066
-Ref: Extension New Mechanism Goals-Footnote-11306430
-Node: Extension Other Design Decisions1306619
-Node: Extension Future Growth1308732
-Node: Notes summary1309338
-Node: Basic Concepts1310496
-Node: Basic High Level1311177
-Ref: figure-general-flow1311459
-Ref: figure-process-flow1312144
-Ref: Basic High Level-Footnote-11315445
-Node: Basic Data Typing1315630
-Node: Glossary1318958
-Node: Copying1350843
-Node: GNU Free Documentation License1388386
-Node: Index1413506
++Ref: General Data Types-Footnote-11040277
++Node: Memory Allocation Functions1040576
++Ref: Memory Allocation Functions-Footnote-11045077
++Node: Constructor Functions1045176
++Node: API Ownership of MPFR and GMP Values1048829
++Node: Registration Functions1050142
++Node: Extension Functions1050842
++Node: Exit Callback Functions1056164
++Node: Extension Version String1057414
++Node: Input Parsers1058077
++Node: Output Wrappers1070798
++Node: Two-way processors1075310
++Node: Printing Messages1077575
++Ref: Printing Messages-Footnote-11078746
++Node: Updating ERRNO1078899
++Node: Requesting Values1079638
++Ref: table-value-types-returned1080375
++Node: Accessing Parameters1081483
++Node: Symbol Table Access1082720
++Node: Symbol table by name1083232
++Ref: Symbol table by name-Footnote-11086256
++Node: Symbol table by cookie1086384
++Ref: Symbol table by cookie-Footnote-11090569
++Node: Cached values1090633
++Ref: Cached values-Footnote-11094169
++Node: Array Manipulation1094322
++Ref: Array Manipulation-Footnote-11095413
++Node: Array Data Types1095450
++Ref: Array Data Types-Footnote-11098108
++Node: Array Functions1098200
++Node: Flattening Arrays1102698
++Node: Creating Arrays1109674
++Node: Redirection API1114441
++Node: Extension API Variables1117274
++Node: Extension Versioning1117985
++Ref: gawk-api-version1118414
++Node: Extension GMP/MPFR Versioning1120145
++Node: Extension API Informational Variables1121773
++Node: Extension API Boilerplate1122846
++Node: Changes from API V11126820
++Node: Finding Extensions1128392
++Node: Extension Example1128951
++Node: Internal File Description1129749
++Node: Internal File Ops1133829
++Ref: Internal File Ops-Footnote-11145179
++Node: Using Internal File Ops1145319
++Ref: Using Internal File Ops-Footnote-11147702
++Node: Extension Samples1147976
++Node: Extension Sample File Functions1149505
++Node: Extension Sample Fnmatch1157154
++Node: Extension Sample Fork1158641
++Node: Extension Sample Inplace1159859
++Node: Extension Sample Ord1163485
++Node: Extension Sample Readdir1164321
++Ref: table-readdir-file-types1165210
++Node: Extension Sample Revout1166277
++Node: Extension Sample Rev2way1166866
++Node: Extension Sample Read write array1167606
++Node: Extension Sample Readfile1169548
++Node: Extension Sample Time1170643
++Node: Extension Sample API Tests1172395
++Node: gawkextlib1172887
++Node: Extension summary1175805
++Node: Extension Exercises1179507
++Node: Language History1180749
++Node: V7/SVR3.11182405
++Node: SVR41184557
++Node: POSIX1185991
++Node: BTL1187372
++Node: POSIX/GNU1188101
++Node: Feature History1193879
++Node: Common Extensions1210198
++Node: Ranges and Locales1211481
++Ref: Ranges and Locales-Footnote-11216097
++Ref: Ranges and Locales-Footnote-21216124
++Ref: Ranges and Locales-Footnote-31216359
++Node: Contributors1216582
++Node: History summary1222579
++Node: Installation1223959
++Node: Gawk Distribution1224903
++Node: Getting1225387
++Node: Extracting1226350
++Node: Distribution contents1227988
++Node: Unix Installation1234468
++Node: Quick Installation1235150
++Node: Shell Startup Files1237564
++Node: Additional Configuration Options1238653
++Node: Configuration Philosophy1240968
++Node: Non-Unix Installation1243337
++Node: PC Installation1243797
++Node: PC Binary Installation1244635
++Node: PC Compiling1245070
++Node: PC Using1246187
++Node: Cygwin1249740
++Node: MSYS1250964
++Node: VMS Installation1251566
++Node: VMS Compilation1252357
++Ref: VMS Compilation-Footnote-11253586
++Node: VMS Dynamic Extensions1253644
++Node: VMS Installation Details1255329
++Node: VMS Running1257582
++Node: VMS GNV1261861
++Node: VMS Old Gawk1262596
++Node: Bugs1263067
++Node: Bug address1263730
++Node: Usenet1266712
++Node: Maintainers1267716
++Node: Other Versions1268901
++Node: Installation summary1276766
++Node: Notes1277975
++Node: Compatibility Mode1278769
++Node: Additions1279551
++Node: Accessing The Source1280476
++Node: Adding Code1281913
++Node: New Ports1288132
++Node: Derived Files1292507
++Ref: Derived Files-Footnote-11298167
++Ref: Derived Files-Footnote-21298202
++Ref: Derived Files-Footnote-31298800
++Node: Future Extensions1298914
++Node: Implementation Limitations1299572
++Node: Extension Design1300782
++Node: Old Extension Problems1301926
++Ref: Old Extension Problems-Footnote-11303444
++Node: Extension New Mechanism Goals1303501
++Ref: Extension New Mechanism Goals-Footnote-11306865
++Node: Extension Other Design Decisions1307054
++Node: Extension Future Growth1309167
++Node: Notes summary1309773
++Node: Basic Concepts1310931
++Node: Basic High Level1311612
++Ref: figure-general-flow1311894
++Ref: figure-process-flow1312579
++Ref: Basic High Level-Footnote-11315880
++Node: Basic Data Typing1316065
++Node: Glossary1319393
++Node: Copying1351278
++Node: GNU Free Documentation License1388821
++Node: Index1413941
End Tag Table
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1a870d555701173c45855ce5023a550dc9f0ee00
commit 1a870d555701173c45855ce5023a550dc9f0ee00
Merge: 7dbf096 ebb1fd6
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Apr 1 20:14:44 2021 +0300
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=7dbf096579d7f17aaf8618518cc456bbaf6ad22b
commit 7dbf096579d7f17aaf8618518cc456bbaf6ad22b
Merge: 2c53d83 a930acd
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Mar 31 21:13:26 2021 +0300
Merge branch 'master' into feature/bool
diff --cc doc/ChangeLog
index 748f24f,34a0b68..79a2326
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@@ -1,7 -1,10 +1,14 @@@
+ 2021-03-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Regexp Operator Details): Added a sidebar on
+ matching the empty regexp. Thanks to Arkadiusz Drabczyk
+ <arkadiusz@drabczyk.org> for pointing out the lack of
+ documentation.
+
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Constructor Functions): Add doc on `make_bool'.
+
2021-03-21 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Other Environment Variables): Document "fnv1a"
diff --cc doc/gawk.info
index 1337e0e,76ecc3c..2200e99
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@@ -38144,542 -38174,542 +38183,542 @@@ Node: Regexp Usage16532
Node: Escape Sequences167362
Node: Regexp Operators173603
Node: Regexp Operator Details174088
- Ref: Regexp Operator Details-Footnote-1180520
- Node: Interval Expressions180667
- Ref: Interval Expressions-Footnote-1182088
- Node: Bracket Expressions182186
- Ref: table-char-classes184662
- Node: Leftmost Longest187988
- Node: Computed Regexps189291
- Node: GNU Regexp Operators192718
- Node: Case-sensitivity196455
- Ref: Case-sensitivity-Footnote-1199321
- Ref: Case-sensitivity-Footnote-2199556
- Node: Regexp Summary199664
- Node: Reading Files201130
- Node: Records203399
- Node: awk split records204474
- Node: gawk split records209174
- Ref: gawk split records-Footnote-1214248
- Node: Fields214285
- Node: Nonconstant Fields217026
- Ref: Nonconstant Fields-Footnote-1219262
- Node: Changing Fields219466
- Node: Field Separators225497
- Node: Default Field Splitting228195
- Node: Regexp Field Splitting229313
- Node: Single Character Fields232990
- Node: Command Line Field Separator234050
- Node: Full Line Fields237268
- Ref: Full Line Fields-Footnote-1238790
- Ref: Full Line Fields-Footnote-2238836
- Node: Field Splitting Summary238937
- Node: Constant Size241011
- Node: Fixed width data241743
- Node: Skipping intervening245210
- Node: Allowing trailing data246008
- Node: Fields with fixed data247045
- Node: Splitting By Content248563
- Ref: Splitting By Content-Footnote-1252346
- Node: More CSV252509
- Node: Testing field creation254101
- Node: Multiple Line255726
- Node: Getline262003
- Node: Plain Getline264472
- Node: Getline/Variable267045
- Node: Getline/File268196
- Node: Getline/Variable/File269584
- Ref: Getline/Variable/File-Footnote-1271189
- Node: Getline/Pipe271277
- Node: Getline/Variable/Pipe273981
- Node: Getline/Coprocess275116
- Node: Getline/Variable/Coprocess276383
- Node: Getline Notes277125
- Node: Getline Summary279922
- Ref: table-getline-variants280346
- Node: Read Timeout281094
- Ref: Read Timeout-Footnote-1285000
- Node: Retrying Input285058
- Node: Command-line directories286257
- Node: Input Summary287163
- Node: Input Exercises290335
- Node: Printing290769
- Node: Print292603
- Node: Print Examples294060
- Node: Output Separators296840
- Node: OFMT298857
- Node: Printf300213
- Node: Basic Printf300998
- Node: Control Letters302572
- Node: Format Modifiers307734
- Node: Printf Examples313749
- Node: Redirection316235
- Node: Special FD323076
- Ref: Special FD-Footnote-1326244
- Node: Special Files326318
- Node: Other Inherited Files326935
- Node: Special Network327936
- Node: Special Caveats328796
- Node: Close Files And Pipes329745
- Ref: table-close-pipe-return-values336652
- Ref: Close Files And Pipes-Footnote-1337465
- Ref: Close Files And Pipes-Footnote-2337613
- Node: Nonfatal337765
- Node: Output Summary340103
- Node: Output Exercises341325
- Node: Expressions342004
- Node: Values343192
- Node: Constants343870
- Node: Scalar Constants344561
- Ref: Scalar Constants-Footnote-1347071
- Node: Nondecimal-numbers347321
- Node: Regexp Constants350322
- Node: Using Constant Regexps350848
- Node: Standard Regexp Constants351470
- Node: Strong Regexp Constants354658
- Node: Variables357670
- Node: Using Variables358327
- Node: Assignment Options360237
- Node: Conversion362708
- Node: Strings And Numbers363232
- Ref: Strings And Numbers-Footnote-1366295
- Node: Locale influences conversions366404
- Ref: table-locale-affects369162
- Node: All Operators369780
- Node: Arithmetic Ops370409
- Node: Concatenation373125
- Ref: Concatenation-Footnote-1375972
- Node: Assignment Ops376079
- Ref: table-assign-ops381070
- Node: Increment Ops382383
- Node: Truth Values and Conditions385843
- Node: Truth Values386917
- Node: Typing and Comparison387965
- Node: Variable Typing388785
- Ref: Variable Typing-Footnote-1395248
- Ref: Variable Typing-Footnote-2395320
- Node: Comparison Operators395397
- Ref: table-relational-ops395816
- Node: POSIX String Comparison399311
- Ref: POSIX String Comparison-Footnote-1401006
- Ref: POSIX String Comparison-Footnote-2401145
- Node: Boolean Ops401229
- Ref: Boolean Ops-Footnote-1405711
- Node: Conditional Exp405803
- Node: Function Calls407539
- Node: Precedence411416
- Node: Locales415075
- Node: Expressions Summary416707
- Node: Patterns and Actions419280
- Node: Pattern Overview420400
- Node: Regexp Patterns422077
- Node: Expression Patterns422619
- Node: Ranges426400
- Node: BEGIN/END429508
- Node: Using BEGIN/END430269
- Ref: Using BEGIN/END-Footnote-1433023
- Node: I/O And BEGIN/END433129
- Node: BEGINFILE/ENDFILE435442
- Node: Empty438673
- Node: Using Shell Variables438990
- Node: Action Overview441264
- Node: Statements443589
- Node: If Statement445437
- Node: While Statement446932
- Node: Do Statement448960
- Node: For Statement450108
- Node: Switch Statement453279
- Node: Break Statement455720
- Node: Continue Statement457812
- Node: Next Statement459639
- Node: Nextfile Statement462022
- Node: Exit Statement464711
- Node: Built-in Variables467114
- Node: User-modified468247
- Node: Auto-set476014
- Ref: Auto-set-Footnote-1492821
- Ref: Auto-set-Footnote-2493027
- Node: ARGC and ARGV493083
- Node: Pattern Action Summary497296
- Node: Arrays499726
- Node: Array Basics501055
- Node: Array Intro501899
- Ref: figure-array-elements503874
- Ref: Array Intro-Footnote-1506578
- Node: Reference to Elements506706
- Node: Assigning Elements509170
- Node: Array Example509661
- Node: Scanning an Array511420
- Node: Controlling Scanning514442
- Ref: Controlling Scanning-Footnote-1520898
- Node: Numeric Array Subscripts521214
- Node: Uninitialized Subscripts523398
- Node: Delete525017
- Ref: Delete-Footnote-1527769
- Node: Multidimensional527826
- Node: Multiscanning530921
- Node: Arrays of Arrays532512
- Node: Arrays Summary537280
- Node: Functions539373
- Node: Built-in540411
- Node: Calling Built-in541492
- Node: Numeric Functions543488
- Ref: Numeric Functions-Footnote-1547514
- Ref: Numeric Functions-Footnote-2548162
- Ref: Numeric Functions-Footnote-3548210
- Node: String Functions548482
- Ref: String Functions-Footnote-1572623
- Ref: String Functions-Footnote-2572751
- Ref: String Functions-Footnote-3572999
- Node: Gory Details573086
- Ref: table-sub-escapes574877
- Ref: table-sub-proposed576396
- Ref: table-posix-sub577759
- Ref: table-gensub-escapes579300
- Ref: Gory Details-Footnote-1580123
- Node: I/O Functions580277
- Ref: table-system-return-values586731
- Ref: I/O Functions-Footnote-1588811
- Ref: I/O Functions-Footnote-2588959
- Node: Time Functions589079
- Ref: Time Functions-Footnote-1599750
- Ref: Time Functions-Footnote-2599818
- Ref: Time Functions-Footnote-3599976
- Ref: Time Functions-Footnote-4600087
- Ref: Time Functions-Footnote-5600199
- Ref: Time Functions-Footnote-6600426
- Node: Bitwise Functions600692
- Ref: table-bitwise-ops601286
- Ref: Bitwise Functions-Footnote-1607349
- Ref: Bitwise Functions-Footnote-2607522
- Node: Type Functions607713
- Node: I18N Functions610576
- Node: User-defined612227
- Node: Definition Syntax613039
- Ref: Definition Syntax-Footnote-1618733
- Node: Function Example618804
- Ref: Function Example-Footnote-1621726
- Node: Function Calling621748
- Node: Calling A Function622336
- Node: Variable Scope623294
- Node: Pass By Value/Reference626288
- Node: Function Caveats628932
- Ref: Function Caveats-Footnote-1630979
- Node: Return Statement631099
- Node: Dynamic Typing634078
- Node: Indirect Calls635008
- Ref: Indirect Calls-Footnote-1645260
- Node: Functions Summary645388
- Node: Library Functions648093
- Ref: Library Functions-Footnote-1651700
- Ref: Library Functions-Footnote-2651843
- Node: Library Names652014
- Ref: Library Names-Footnote-1655681
- Ref: Library Names-Footnote-2655904
- Node: General Functions655990
- Node: Strtonum Function657093
- Node: Assert Function660115
- Node: Round Function663441
- Node: Cliff Random Function664981
- Node: Ordinal Functions665997
- Ref: Ordinal Functions-Footnote-1669060
- Ref: Ordinal Functions-Footnote-2669312
- Node: Join Function669522
- Ref: Join Function-Footnote-1671292
- Node: Getlocaltime Function671492
- Node: Readfile Function675234
- Node: Shell Quoting677211
- Node: Data File Management678612
- Node: Filetrans Function679244
- Node: Rewind Function683340
- Node: File Checking685249
- Ref: File Checking-Footnote-1686583
- Node: Empty Files686784
- Node: Ignoring Assigns688763
- Node: Getopt Function690313
- Ref: Getopt Function-Footnote-1705524
- Node: Passwd Functions705724
- Ref: Passwd Functions-Footnote-1714563
- Node: Group Functions714651
- Ref: Group Functions-Footnote-1722549
- Node: Walking Arrays722756
- Node: Library Functions Summary725764
- Node: Library Exercises727170
- Node: Sample Programs727635
- Node: Running Examples728405
- Node: Clones729133
- Node: Cut Program730357
- Node: Egrep Program740497
- Node: Id Program749498
- Node: Split Program759445
- Ref: Split Program-Footnote-1769335
- Node: Tee Program769508
- Node: Uniq Program772298
- Node: Wc Program779886
- Node: Bytes vs. Characters780283
- Node: Using extensions781831
- Node: wc program782585
- Node: Miscellaneous Programs787450
- Node: Dupword Program788663
- Node: Alarm Program790693
- Node: Translate Program795548
- Ref: Translate Program-Footnote-1800113
- Node: Labels Program800383
- Ref: Labels Program-Footnote-1803734
- Node: Word Sorting803818
- Node: History Sorting807890
- Node: Extract Program810115
- Node: Simple Sed818169
- Node: Igawk Program821243
- Ref: Igawk Program-Footnote-1835574
- Ref: Igawk Program-Footnote-2835776
- Ref: Igawk Program-Footnote-3835898
- Node: Anagram Program836013
- Node: Signature Program839075
- Node: Programs Summary840322
- Node: Programs Exercises841536
- Ref: Programs Exercises-Footnote-1845666
- Node: Advanced Features845752
- Node: Nondecimal Data847819
- Node: Array Sorting849410
- Node: Controlling Array Traversal850110
- Ref: Controlling Array Traversal-Footnote-1858478
- Node: Array Sorting Functions858596
- Ref: Array Sorting Functions-Footnote-1863687
- Node: Two-way I/O863883
- Ref: Two-way I/O-Footnote-1871604
- Ref: Two-way I/O-Footnote-2871791
- Node: TCP/IP Networking871873
- Node: Profiling874991
- Node: Extension Philosophy884300
- Node: Advanced Features Summary885779
- Node: Internationalization887794
- Node: I18N and L10N889274
- Node: Explaining gettext889961
- Ref: Explaining gettext-Footnote-1895853
- Ref: Explaining gettext-Footnote-2896038
- Node: Programmer i18n896203
- Ref: Programmer i18n-Footnote-1901152
- Node: Translator i18n901201
- Node: String Extraction901995
- Ref: String Extraction-Footnote-1903127
- Node: Printf Ordering903213
- Ref: Printf Ordering-Footnote-1905999
- Node: I18N Portability906063
- Ref: I18N Portability-Footnote-1908519
- Node: I18N Example908582
- Ref: I18N Example-Footnote-1911857
- Ref: I18N Example-Footnote-2911930
- Node: Gawk I18N912039
- Node: I18N Summary912688
- Node: Debugger914029
- Node: Debugging915029
- Node: Debugging Concepts915470
- Node: Debugging Terms917279
- Node: Awk Debugging919854
- Ref: Awk Debugging-Footnote-1920799
- Node: Sample Debugging Session920931
- Node: Debugger Invocation921465
- Node: Finding The Bug922851
- Node: List of Debugger Commands929325
- Node: Breakpoint Control930658
- Node: Debugger Execution Control934352
- Node: Viewing And Changing Data937714
- Node: Execution Stack941255
- Node: Debugger Info942892
- Node: Miscellaneous Debugger Commands946963
- Node: Readline Support952025
- Node: Limitations952921
- Node: Debugging Summary955475
- Node: Namespaces956754
- Node: Global Namespace957865
- Node: Qualified Names959263
- Node: Default Namespace960262
- Node: Changing The Namespace961003
- Node: Naming Rules962617
- Node: Internal Name Management964465
- Node: Namespace Example965507
- Node: Namespace And Features968069
- Node: Namespace Summary969504
- Node: Arbitrary Precision Arithmetic970981
- Node: Computer Arithmetic972468
- Ref: table-numeric-ranges976234
- Ref: table-floating-point-ranges976727
- Ref: Computer Arithmetic-Footnote-1977385
- Node: Math Definitions977442
- Ref: table-ieee-formats980418
- Node: MPFR features980985
- Node: FP Math Caution982703
- Ref: FP Math Caution-Footnote-1983775
- Node: Inexactness of computations984144
- Node: Inexact representation985175
- Node: Comparing FP Values986535
- Node: Errors accumulate987776
- Node: Strange values989232
- Ref: Strange values-Footnote-1991820
- Node: Getting Accuracy991925
- Node: Try To Round994635
- Node: Setting precision995534
- Ref: table-predefined-precision-strings996231
- Node: Setting the rounding mode998061
- Ref: table-gawk-rounding-modes998435
- Ref: Setting the rounding mode-Footnote-11002366
- Node: Arbitrary Precision Integers1002545
- Ref: Arbitrary Precision Integers-Footnote-11005720
- Node: Checking for MPFR1005869
- Node: POSIX Floating Point Problems1007343
- Ref: POSIX Floating Point Problems-Footnote-11011628
- Node: Floating point summary1011666
- Node: Dynamic Extensions1013856
- Node: Extension Intro1015409
- Node: Plugin License1016675
- Node: Extension Mechanism Outline1017472
- Ref: figure-load-extension1017911
- Ref: figure-register-new-function1019476
- Ref: figure-call-new-function1020568
- Node: Extension API Description1022630
- Node: Extension API Functions Introduction1024343
- Ref: table-api-std-headers1026179
- Node: General Data Types1030428
- Ref: General Data Types-Footnote-11039134
- Node: Memory Allocation Functions1039433
- Ref: Memory Allocation Functions-Footnote-11043934
- Node: Constructor Functions1044033
- Node: API Ownership of MPFR and GMP Values1047686
- Node: Registration Functions1048999
- Node: Extension Functions1049699
- Node: Exit Callback Functions1055021
- Node: Extension Version String1056271
- Node: Input Parsers1056934
- Node: Output Wrappers1069655
- Node: Two-way processors1074167
- Node: Printing Messages1076432
- Ref: Printing Messages-Footnote-11077603
- Node: Updating ERRNO1077756
- Node: Requesting Values1078495
- Ref: table-value-types-returned1079232
- Node: Accessing Parameters1080340
- Node: Symbol Table Access1081577
- Node: Symbol table by name1082089
- Ref: Symbol table by name-Footnote-11085113
- Node: Symbol table by cookie1085241
- Ref: Symbol table by cookie-Footnote-11089426
- Node: Cached values1089490
- Ref: Cached values-Footnote-11093026
- Node: Array Manipulation1093179
- Ref: Array Manipulation-Footnote-11094270
- Node: Array Data Types1094307
- Ref: Array Data Types-Footnote-11096965
- Node: Array Functions1097057
- Node: Flattening Arrays1101555
- Node: Creating Arrays1108531
- Node: Redirection API1113298
- Node: Extension API Variables1116131
- Node: Extension Versioning1116842
- Ref: gawk-api-version1117271
- Node: Extension GMP/MPFR Versioning1119002
- Node: Extension API Informational Variables1120630
- Node: Extension API Boilerplate1121703
- Node: Changes from API V11125677
- Node: Finding Extensions1127249
- Node: Extension Example1127808
- Node: Internal File Description1128606
- Node: Internal File Ops1132686
- Ref: Internal File Ops-Footnote-11144036
- Node: Using Internal File Ops1144176
- Ref: Using Internal File Ops-Footnote-11146559
- Node: Extension Samples1146833
- Node: Extension Sample File Functions1148362
- Node: Extension Sample Fnmatch1156011
- Node: Extension Sample Fork1157498
- Node: Extension Sample Inplace1158716
- Node: Extension Sample Ord1162342
- Node: Extension Sample Readdir1163178
- Ref: table-readdir-file-types1164067
- Node: Extension Sample Revout1165134
- Node: Extension Sample Rev2way1165723
- Node: Extension Sample Read write array1166463
- Node: Extension Sample Readfile1168405
- Node: Extension Sample Time1169500
- Node: Extension Sample API Tests1171252
- Node: gawkextlib1171744
- Node: Extension summary1174662
- Node: Extension Exercises1178364
- Node: Language History1179606
- Node: V7/SVR3.11181262
- Node: SVR41183414
- Node: POSIX1184848
- Node: BTL1186229
- Node: POSIX/GNU1186958
- Node: Feature History1192736
- Node: Common Extensions1209055
- Node: Ranges and Locales1210338
- Ref: Ranges and Locales-Footnote-11214954
- Ref: Ranges and Locales-Footnote-21214981
- Ref: Ranges and Locales-Footnote-31215216
- Node: Contributors1215439
- Node: History summary1221436
- Node: Installation1222816
- Node: Gawk Distribution1223760
- Node: Getting1224244
- Node: Extracting1225207
- Node: Distribution contents1226845
- Node: Unix Installation1233325
- Node: Quick Installation1234007
- Node: Shell Startup Files1236421
- Node: Additional Configuration Options1237510
- Node: Configuration Philosophy1239825
- Node: Non-Unix Installation1242194
- Node: PC Installation1242654
- Node: PC Binary Installation1243492
- Node: PC Compiling1243927
- Node: PC Using1245044
- Node: Cygwin1248597
- Node: MSYS1249821
- Node: VMS Installation1250423
- Node: VMS Compilation1251214
- Ref: VMS Compilation-Footnote-11252443
- Node: VMS Dynamic Extensions1252501
- Node: VMS Installation Details1254186
- Node: VMS Running1256439
- Node: VMS GNV1260718
- Node: VMS Old Gawk1261453
- Node: Bugs1261924
- Node: Bug address1262587
- Node: Usenet1265569
- Node: Maintainers1266573
- Node: Other Versions1267758
- Node: Installation summary1275623
- Node: Notes1276832
- Node: Compatibility Mode1277626
- Node: Additions1278408
- Node: Accessing The Source1279333
- Node: Adding Code1280770
- Node: New Ports1286989
- Node: Derived Files1291364
- Ref: Derived Files-Footnote-11297024
- Ref: Derived Files-Footnote-21297059
- Ref: Derived Files-Footnote-31297657
- Node: Future Extensions1297771
- Node: Implementation Limitations1298429
- Node: Extension Design1299639
- Node: Old Extension Problems1300783
- Ref: Old Extension Problems-Footnote-11302301
- Node: Extension New Mechanism Goals1302358
- Ref: Extension New Mechanism Goals-Footnote-11305722
- Node: Extension Other Design Decisions1305911
- Node: Extension Future Growth1308024
- Node: Notes summary1308630
- Node: Basic Concepts1309788
- Node: Basic High Level1310469
- Ref: figure-general-flow1310751
- Ref: figure-process-flow1311436
- Ref: Basic High Level-Footnote-11314737
- Node: Basic Data Typing1314922
- Node: Glossary1318250
- Node: Copying1350135
- Node: GNU Free Documentation License1387678
- Node: Index1412798
+ Ref: Regexp Operator Details-Footnote-1181452
+ Node: Interval Expressions181599
+ Ref: Interval Expressions-Footnote-1183020
+ Node: Bracket Expressions183118
+ Ref: table-char-classes185594
+ Node: Leftmost Longest188920
+ Node: Computed Regexps190223
+ Node: GNU Regexp Operators193650
+ Node: Case-sensitivity197387
+ Ref: Case-sensitivity-Footnote-1200253
+ Ref: Case-sensitivity-Footnote-2200488
+ Node: Regexp Summary200596
+ Node: Reading Files202062
+ Node: Records204331
+ Node: awk split records205406
+ Node: gawk split records210106
+ Ref: gawk split records-Footnote-1215180
+ Node: Fields215217
+ Node: Nonconstant Fields217958
+ Ref: Nonconstant Fields-Footnote-1220194
+ Node: Changing Fields220398
+ Node: Field Separators226429
+ Node: Default Field Splitting229127
+ Node: Regexp Field Splitting230245
+ Node: Single Character Fields233922
+ Node: Command Line Field Separator234982
+ Node: Full Line Fields238200
+ Ref: Full Line Fields-Footnote-1239722
+ Ref: Full Line Fields-Footnote-2239768
+ Node: Field Splitting Summary239869
+ Node: Constant Size241943
+ Node: Fixed width data242675
+ Node: Skipping intervening246142
+ Node: Allowing trailing data246940
+ Node: Fields with fixed data247977
+ Node: Splitting By Content249495
+ Ref: Splitting By Content-Footnote-1253278
+ Node: More CSV253441
+ Node: Testing field creation255033
+ Node: Multiple Line256658
+ Node: Getline262935
+ Node: Plain Getline265404
+ Node: Getline/Variable267977
+ Node: Getline/File269128
+ Node: Getline/Variable/File270516
+ Ref: Getline/Variable/File-Footnote-1272121
+ Node: Getline/Pipe272209
+ Node: Getline/Variable/Pipe274913
+ Node: Getline/Coprocess276048
+ Node: Getline/Variable/Coprocess277315
+ Node: Getline Notes278057
+ Node: Getline Summary280854
+ Ref: table-getline-variants281278
+ Node: Read Timeout282026
+ Ref: Read Timeout-Footnote-1285932
+ Node: Retrying Input285990
+ Node: Command-line directories287189
+ Node: Input Summary288095
+ Node: Input Exercises291267
+ Node: Printing291701
+ Node: Print293535
+ Node: Print Examples294992
+ Node: Output Separators297772
+ Node: OFMT299789
+ Node: Printf301145
+ Node: Basic Printf301930
+ Node: Control Letters303504
+ Node: Format Modifiers308666
+ Node: Printf Examples314681
+ Node: Redirection317167
+ Node: Special FD324008
+ Ref: Special FD-Footnote-1327176
+ Node: Special Files327250
+ Node: Other Inherited Files327867
+ Node: Special Network328868
+ Node: Special Caveats329728
+ Node: Close Files And Pipes330677
+ Ref: table-close-pipe-return-values337584
+ Ref: Close Files And Pipes-Footnote-1338397
+ Ref: Close Files And Pipes-Footnote-2338545
+ Node: Nonfatal338697
+ Node: Output Summary341035
+ Node: Output Exercises342257
+ Node: Expressions342936
+ Node: Values344124
+ Node: Constants344802
+ Node: Scalar Constants345493
+ Ref: Scalar Constants-Footnote-1348003
+ Node: Nondecimal-numbers348253
+ Node: Regexp Constants351254
+ Node: Using Constant Regexps351780
+ Node: Standard Regexp Constants352402
+ Node: Strong Regexp Constants355590
+ Node: Variables358602
+ Node: Using Variables359259
+ Node: Assignment Options361169
+ Node: Conversion363640
+ Node: Strings And Numbers364164
+ Ref: Strings And Numbers-Footnote-1367227
+ Node: Locale influences conversions367336
+ Ref: table-locale-affects370094
+ Node: All Operators370712
+ Node: Arithmetic Ops371341
+ Node: Concatenation374057
+ Ref: Concatenation-Footnote-1376904
+ Node: Assignment Ops377011
+ Ref: table-assign-ops382002
+ Node: Increment Ops383315
+ Node: Truth Values and Conditions386775
+ Node: Truth Values387849
+ Node: Typing and Comparison388897
+ Node: Variable Typing389717
+ Ref: Variable Typing-Footnote-1396180
+ Ref: Variable Typing-Footnote-2396252
+ Node: Comparison Operators396329
+ Ref: table-relational-ops396748
+ Node: POSIX String Comparison400243
+ Ref: POSIX String Comparison-Footnote-1401938
+ Ref: POSIX String Comparison-Footnote-2402077
+ Node: Boolean Ops402161
+ Ref: Boolean Ops-Footnote-1406643
+ Node: Conditional Exp406735
+ Node: Function Calls408471
+ Node: Precedence412348
+ Node: Locales416007
+ Node: Expressions Summary417639
+ Node: Patterns and Actions420212
+ Node: Pattern Overview421332
+ Node: Regexp Patterns423009
+ Node: Expression Patterns423551
+ Node: Ranges427332
+ Node: BEGIN/END430440
+ Node: Using BEGIN/END431201
+ Ref: Using BEGIN/END-Footnote-1433955
+ Node: I/O And BEGIN/END434061
+ Node: BEGINFILE/ENDFILE436374
+ Node: Empty439605
+ Node: Using Shell Variables439922
+ Node: Action Overview442196
+ Node: Statements444521
+ Node: If Statement446369
+ Node: While Statement447864
+ Node: Do Statement449892
+ Node: For Statement451040
+ Node: Switch Statement454211
+ Node: Break Statement456652
+ Node: Continue Statement458744
+ Node: Next Statement460571
+ Node: Nextfile Statement462954
+ Node: Exit Statement465643
+ Node: Built-in Variables468046
+ Node: User-modified469179
+ Node: Auto-set476946
+ Ref: Auto-set-Footnote-1493753
+ Ref: Auto-set-Footnote-2493959
+ Node: ARGC and ARGV494015
+ Node: Pattern Action Summary498228
+ Node: Arrays500658
+ Node: Array Basics501987
+ Node: Array Intro502831
+ Ref: figure-array-elements504806
+ Ref: Array Intro-Footnote-1507510
+ Node: Reference to Elements507638
+ Node: Assigning Elements510102
+ Node: Array Example510593
+ Node: Scanning an Array512352
+ Node: Controlling Scanning515374
+ Ref: Controlling Scanning-Footnote-1521830
+ Node: Numeric Array Subscripts522146
+ Node: Uninitialized Subscripts524330
+ Node: Delete525949
+ Ref: Delete-Footnote-1528701
+ Node: Multidimensional528758
+ Node: Multiscanning531853
+ Node: Arrays of Arrays533444
+ Node: Arrays Summary538212
+ Node: Functions540305
+ Node: Built-in541343
+ Node: Calling Built-in542424
+ Node: Numeric Functions544420
+ Ref: Numeric Functions-Footnote-1548446
+ Ref: Numeric Functions-Footnote-2549094
+ Ref: Numeric Functions-Footnote-3549142
+ Node: String Functions549414
+ Ref: String Functions-Footnote-1573555
+ Ref: String Functions-Footnote-2573683
+ Ref: String Functions-Footnote-3573931
+ Node: Gory Details574018
+ Ref: table-sub-escapes575809
+ Ref: table-sub-proposed577328
+ Ref: table-posix-sub578691
+ Ref: table-gensub-escapes580232
+ Ref: Gory Details-Footnote-1581055
+ Node: I/O Functions581209
+ Ref: table-system-return-values587663
+ Ref: I/O Functions-Footnote-1589743
+ Ref: I/O Functions-Footnote-2589891
+ Node: Time Functions590011
+ Ref: Time Functions-Footnote-1600682
+ Ref: Time Functions-Footnote-2600750
+ Ref: Time Functions-Footnote-3600908
+ Ref: Time Functions-Footnote-4601019
+ Ref: Time Functions-Footnote-5601131
+ Ref: Time Functions-Footnote-6601358
+ Node: Bitwise Functions601624
+ Ref: table-bitwise-ops602218
+ Ref: Bitwise Functions-Footnote-1608281
+ Ref: Bitwise Functions-Footnote-2608454
+ Node: Type Functions608645
+ Node: I18N Functions611508
+ Node: User-defined613159
+ Node: Definition Syntax613971
+ Ref: Definition Syntax-Footnote-1619665
+ Node: Function Example619736
+ Ref: Function Example-Footnote-1622658
+ Node: Function Calling622680
+ Node: Calling A Function623268
+ Node: Variable Scope624226
+ Node: Pass By Value/Reference627220
+ Node: Function Caveats629864
+ Ref: Function Caveats-Footnote-1631911
+ Node: Return Statement632031
+ Node: Dynamic Typing635010
+ Node: Indirect Calls635940
+ Ref: Indirect Calls-Footnote-1646192
+ Node: Functions Summary646320
+ Node: Library Functions649025
+ Ref: Library Functions-Footnote-1652632
+ Ref: Library Functions-Footnote-2652775
+ Node: Library Names652946
+ Ref: Library Names-Footnote-1656613
+ Ref: Library Names-Footnote-2656836
+ Node: General Functions656922
+ Node: Strtonum Function658025
+ Node: Assert Function661047
+ Node: Round Function664373
+ Node: Cliff Random Function665913
+ Node: Ordinal Functions666929
+ Ref: Ordinal Functions-Footnote-1669992
+ Ref: Ordinal Functions-Footnote-2670244
+ Node: Join Function670454
+ Ref: Join Function-Footnote-1672224
+ Node: Getlocaltime Function672424
+ Node: Readfile Function676166
+ Node: Shell Quoting678143
+ Node: Data File Management679544
+ Node: Filetrans Function680176
+ Node: Rewind Function684272
+ Node: File Checking686181
+ Ref: File Checking-Footnote-1687515
+ Node: Empty Files687716
+ Node: Ignoring Assigns689695
+ Node: Getopt Function691245
+ Ref: Getopt Function-Footnote-1706456
+ Node: Passwd Functions706656
+ Ref: Passwd Functions-Footnote-1715495
+ Node: Group Functions715583
+ Ref: Group Functions-Footnote-1723481
+ Node: Walking Arrays723688
+ Node: Library Functions Summary726696
+ Node: Library Exercises728102
+ Node: Sample Programs728567
+ Node: Running Examples729337
+ Node: Clones730065
+ Node: Cut Program731289
+ Node: Egrep Program741429
+ Node: Id Program750430
+ Node: Split Program760377
+ Ref: Split Program-Footnote-1770267
+ Node: Tee Program770440
+ Node: Uniq Program773230
+ Node: Wc Program780818
+ Node: Bytes vs. Characters781215
+ Node: Using extensions782763
+ Node: wc program783517
+ Node: Miscellaneous Programs788382
+ Node: Dupword Program789595
+ Node: Alarm Program791625
+ Node: Translate Program796480
+ Ref: Translate Program-Footnote-1801045
+ Node: Labels Program801315
+ Ref: Labels Program-Footnote-1804666
+ Node: Word Sorting804750
+ Node: History Sorting808822
+ Node: Extract Program811047
+ Node: Simple Sed819101
+ Node: Igawk Program822175
+ Ref: Igawk Program-Footnote-1836506
+ Ref: Igawk Program-Footnote-2836708
+ Ref: Igawk Program-Footnote-3836830
+ Node: Anagram Program836945
+ Node: Signature Program840007
+ Node: Programs Summary841254
+ Node: Programs Exercises842468
+ Ref: Programs Exercises-Footnote-1846598
+ Node: Advanced Features846684
+ Node: Nondecimal Data848751
+ Node: Array Sorting850342
+ Node: Controlling Array Traversal851042
+ Ref: Controlling Array Traversal-Footnote-1859410
+ Node: Array Sorting Functions859528
+ Ref: Array Sorting Functions-Footnote-1864619
+ Node: Two-way I/O864815
+ Ref: Two-way I/O-Footnote-1872536
+ Ref: Two-way I/O-Footnote-2872723
+ Node: TCP/IP Networking872805
+ Node: Profiling875923
+ Node: Extension Philosophy885232
+ Node: Advanced Features Summary886711
+ Node: Internationalization888726
+ Node: I18N and L10N890206
+ Node: Explaining gettext890893
+ Ref: Explaining gettext-Footnote-1896785
+ Ref: Explaining gettext-Footnote-2896970
+ Node: Programmer i18n897135
+ Ref: Programmer i18n-Footnote-1902084
+ Node: Translator i18n902133
+ Node: String Extraction902927
+ Ref: String Extraction-Footnote-1904059
+ Node: Printf Ordering904145
+ Ref: Printf Ordering-Footnote-1906931
+ Node: I18N Portability906995
+ Ref: I18N Portability-Footnote-1909451
+ Node: I18N Example909514
+ Ref: I18N Example-Footnote-1912789
+ Ref: I18N Example-Footnote-2912862
+ Node: Gawk I18N912971
+ Node: I18N Summary913620
+ Node: Debugger914961
+ Node: Debugging915961
+ Node: Debugging Concepts916402
+ Node: Debugging Terms918211
+ Node: Awk Debugging920786
+ Ref: Awk Debugging-Footnote-1921731
+ Node: Sample Debugging Session921863
+ Node: Debugger Invocation922397
+ Node: Finding The Bug923783
+ Node: List of Debugger Commands930257
+ Node: Breakpoint Control931590
+ Node: Debugger Execution Control935284
+ Node: Viewing And Changing Data938646
+ Node: Execution Stack942187
+ Node: Debugger Info943824
+ Node: Miscellaneous Debugger Commands947895
+ Node: Readline Support952957
+ Node: Limitations953853
+ Node: Debugging Summary956407
+ Node: Namespaces957686
+ Node: Global Namespace958797
+ Node: Qualified Names960195
+ Node: Default Namespace961194
+ Node: Changing The Namespace961935
+ Node: Naming Rules963549
+ Node: Internal Name Management965397
+ Node: Namespace Example966439
+ Node: Namespace And Features969001
+ Node: Namespace Summary970436
+ Node: Arbitrary Precision Arithmetic971913
+ Node: Computer Arithmetic973400
+ Ref: table-numeric-ranges977166
+ Ref: table-floating-point-ranges977659
+ Ref: Computer Arithmetic-Footnote-1978317
+ Node: Math Definitions978374
+ Ref: table-ieee-formats981350
+ Node: MPFR features981917
+ Node: FP Math Caution983635
+ Ref: FP Math Caution-Footnote-1984707
+ Node: Inexactness of computations985076
+ Node: Inexact representation986107
+ Node: Comparing FP Values987467
+ Node: Errors accumulate988708
+ Node: Strange values990164
+ Ref: Strange values-Footnote-1992752
+ Node: Getting Accuracy992857
+ Node: Try To Round995567
+ Node: Setting precision996466
+ Ref: table-predefined-precision-strings997163
+ Node: Setting the rounding mode998993
+ Ref: table-gawk-rounding-modes999367
+ Ref: Setting the rounding mode-Footnote-11003298
+ Node: Arbitrary Precision Integers1003477
+ Ref: Arbitrary Precision Integers-Footnote-11006652
+ Node: Checking for MPFR1006801
+ Node: POSIX Floating Point Problems1008275
+ Ref: POSIX Floating Point Problems-Footnote-11012560
+ Node: Floating point summary1012598
+ Node: Dynamic Extensions1014788
+ Node: Extension Intro1016341
+ Node: Plugin License1017607
+ Node: Extension Mechanism Outline1018404
+ Ref: figure-load-extension1018843
+ Ref: figure-register-new-function1020408
+ Ref: figure-call-new-function1021500
+ Node: Extension API Description1023562
+ Node: Extension API Functions Introduction1025275
+ Ref: table-api-std-headers1027111
+ Node: General Data Types1031360
-Ref: General Data Types-Footnote-11039990
-Node: Memory Allocation Functions1040289
-Ref: Memory Allocation Functions-Footnote-11044790
-Node: Constructor Functions1044889
-Node: API Ownership of MPFR and GMP Values1048355
-Node: Registration Functions1049668
-Node: Extension Functions1050368
-Node: Exit Callback Functions1055690
-Node: Extension Version String1056940
-Node: Input Parsers1057603
-Node: Output Wrappers1070324
-Node: Two-way processors1074836
-Node: Printing Messages1077101
-Ref: Printing Messages-Footnote-11078272
-Node: Updating ERRNO1078425
-Node: Requesting Values1079164
-Ref: table-value-types-returned1079901
-Node: Accessing Parameters1080837
-Node: Symbol Table Access1082074
-Node: Symbol table by name1082586
-Ref: Symbol table by name-Footnote-11085610
-Node: Symbol table by cookie1085738
-Ref: Symbol table by cookie-Footnote-11089923
-Node: Cached values1089987
-Ref: Cached values-Footnote-11093523
-Node: Array Manipulation1093676
-Ref: Array Manipulation-Footnote-11094767
-Node: Array Data Types1094804
-Ref: Array Data Types-Footnote-11097462
-Node: Array Functions1097554
-Node: Flattening Arrays1102052
-Node: Creating Arrays1109028
-Node: Redirection API1113795
-Node: Extension API Variables1116628
-Node: Extension Versioning1117339
-Ref: gawk-api-version1117768
-Node: Extension GMP/MPFR Versioning1119499
-Node: Extension API Informational Variables1121127
-Node: Extension API Boilerplate1122200
-Node: Changes from API V11126174
-Node: Finding Extensions1127746
-Node: Extension Example1128305
-Node: Internal File Description1129103
-Node: Internal File Ops1133183
-Ref: Internal File Ops-Footnote-11144533
-Node: Using Internal File Ops1144673
-Ref: Using Internal File Ops-Footnote-11147056
-Node: Extension Samples1147330
-Node: Extension Sample File Functions1148859
-Node: Extension Sample Fnmatch1156508
-Node: Extension Sample Fork1157995
-Node: Extension Sample Inplace1159213
-Node: Extension Sample Ord1162839
-Node: Extension Sample Readdir1163675
-Ref: table-readdir-file-types1164564
-Node: Extension Sample Revout1165631
-Node: Extension Sample Rev2way1166220
-Node: Extension Sample Read write array1166960
-Node: Extension Sample Readfile1168902
-Node: Extension Sample Time1169997
-Node: Extension Sample API Tests1171749
-Node: gawkextlib1172241
-Node: Extension summary1175159
-Node: Extension Exercises1178861
-Node: Language History1180103
-Node: V7/SVR3.11181759
-Node: SVR41183911
-Node: POSIX1185345
-Node: BTL1186726
-Node: POSIX/GNU1187455
-Node: Feature History1193233
-Node: Common Extensions1209552
-Node: Ranges and Locales1210835
-Ref: Ranges and Locales-Footnote-11215451
-Ref: Ranges and Locales-Footnote-21215478
-Ref: Ranges and Locales-Footnote-31215713
-Node: Contributors1215936
-Node: History summary1221933
-Node: Installation1223313
-Node: Gawk Distribution1224257
-Node: Getting1224741
-Node: Extracting1225704
-Node: Distribution contents1227342
-Node: Unix Installation1233822
-Node: Quick Installation1234504
-Node: Shell Startup Files1236918
-Node: Additional Configuration Options1238007
-Node: Configuration Philosophy1240322
-Node: Non-Unix Installation1242691
-Node: PC Installation1243151
-Node: PC Binary Installation1243989
-Node: PC Compiling1244424
-Node: PC Using1245541
-Node: Cygwin1249094
-Node: MSYS1250318
-Node: VMS Installation1250920
-Node: VMS Compilation1251711
-Ref: VMS Compilation-Footnote-11252940
-Node: VMS Dynamic Extensions1252998
-Node: VMS Installation Details1254683
-Node: VMS Running1256936
-Node: VMS GNV1261215
-Node: VMS Old Gawk1261950
-Node: Bugs1262421
-Node: Bug address1263084
-Node: Usenet1266066
-Node: Maintainers1267070
-Node: Other Versions1268255
-Node: Installation summary1276120
-Node: Notes1277329
-Node: Compatibility Mode1278123
-Node: Additions1278905
-Node: Accessing The Source1279830
-Node: Adding Code1281267
-Node: New Ports1287486
-Node: Derived Files1291861
-Ref: Derived Files-Footnote-11297521
-Ref: Derived Files-Footnote-21297556
-Ref: Derived Files-Footnote-31298154
-Node: Future Extensions1298268
-Node: Implementation Limitations1298926
-Node: Extension Design1300136
-Node: Old Extension Problems1301280
-Ref: Old Extension Problems-Footnote-11302798
-Node: Extension New Mechanism Goals1302855
-Ref: Extension New Mechanism Goals-Footnote-11306219
-Node: Extension Other Design Decisions1306408
-Node: Extension Future Growth1308521
-Node: Notes summary1309127
-Node: Basic Concepts1310285
-Node: Basic High Level1310966
-Ref: figure-general-flow1311248
-Ref: figure-process-flow1311933
-Ref: Basic High Level-Footnote-11315234
-Node: Basic Data Typing1315419
-Node: Glossary1318747
-Node: Copying1350632
-Node: GNU Free Documentation License1388175
-Node: Index1413295
++Ref: General Data Types-Footnote-11040066
++Node: Memory Allocation Functions1040365
++Ref: Memory Allocation Functions-Footnote-11044866
++Node: Constructor Functions1044965
++Node: API Ownership of MPFR and GMP Values1048618
++Node: Registration Functions1049931
++Node: Extension Functions1050631
++Node: Exit Callback Functions1055953
++Node: Extension Version String1057203
++Node: Input Parsers1057866
++Node: Output Wrappers1070587
++Node: Two-way processors1075099
++Node: Printing Messages1077364
++Ref: Printing Messages-Footnote-11078535
++Node: Updating ERRNO1078688
++Node: Requesting Values1079427
++Ref: table-value-types-returned1080164
++Node: Accessing Parameters1081272
++Node: Symbol Table Access1082509
++Node: Symbol table by name1083021
++Ref: Symbol table by name-Footnote-11086045
++Node: Symbol table by cookie1086173
++Ref: Symbol table by cookie-Footnote-11090358
++Node: Cached values1090422
++Ref: Cached values-Footnote-11093958
++Node: Array Manipulation1094111
++Ref: Array Manipulation-Footnote-11095202
++Node: Array Data Types1095239
++Ref: Array Data Types-Footnote-11097897
++Node: Array Functions1097989
++Node: Flattening Arrays1102487
++Node: Creating Arrays1109463
++Node: Redirection API1114230
++Node: Extension API Variables1117063
++Node: Extension Versioning1117774
++Ref: gawk-api-version1118203
++Node: Extension GMP/MPFR Versioning1119934
++Node: Extension API Informational Variables1121562
++Node: Extension API Boilerplate1122635
++Node: Changes from API V11126609
++Node: Finding Extensions1128181
++Node: Extension Example1128740
++Node: Internal File Description1129538
++Node: Internal File Ops1133618
++Ref: Internal File Ops-Footnote-11144968
++Node: Using Internal File Ops1145108
++Ref: Using Internal File Ops-Footnote-11147491
++Node: Extension Samples1147765
++Node: Extension Sample File Functions1149294
++Node: Extension Sample Fnmatch1156943
++Node: Extension Sample Fork1158430
++Node: Extension Sample Inplace1159648
++Node: Extension Sample Ord1163274
++Node: Extension Sample Readdir1164110
++Ref: table-readdir-file-types1164999
++Node: Extension Sample Revout1166066
++Node: Extension Sample Rev2way1166655
++Node: Extension Sample Read write array1167395
++Node: Extension Sample Readfile1169337
++Node: Extension Sample Time1170432
++Node: Extension Sample API Tests1172184
++Node: gawkextlib1172676
++Node: Extension summary1175594
++Node: Extension Exercises1179296
++Node: Language History1180538
++Node: V7/SVR3.11182194
++Node: SVR41184346
++Node: POSIX1185780
++Node: BTL1187161
++Node: POSIX/GNU1187890
++Node: Feature History1193668
++Node: Common Extensions1209987
++Node: Ranges and Locales1211270
++Ref: Ranges and Locales-Footnote-11215886
++Ref: Ranges and Locales-Footnote-21215913
++Ref: Ranges and Locales-Footnote-31216148
++Node: Contributors1216371
++Node: History summary1222368
++Node: Installation1223748
++Node: Gawk Distribution1224692
++Node: Getting1225176
++Node: Extracting1226139
++Node: Distribution contents1227777
++Node: Unix Installation1234257
++Node: Quick Installation1234939
++Node: Shell Startup Files1237353
++Node: Additional Configuration Options1238442
++Node: Configuration Philosophy1240757
++Node: Non-Unix Installation1243126
++Node: PC Installation1243586
++Node: PC Binary Installation1244424
++Node: PC Compiling1244859
++Node: PC Using1245976
++Node: Cygwin1249529
++Node: MSYS1250753
++Node: VMS Installation1251355
++Node: VMS Compilation1252146
++Ref: VMS Compilation-Footnote-11253375
++Node: VMS Dynamic Extensions1253433
++Node: VMS Installation Details1255118
++Node: VMS Running1257371
++Node: VMS GNV1261650
++Node: VMS Old Gawk1262385
++Node: Bugs1262856
++Node: Bug address1263519
++Node: Usenet1266501
++Node: Maintainers1267505
++Node: Other Versions1268690
++Node: Installation summary1276555
++Node: Notes1277764
++Node: Compatibility Mode1278558
++Node: Additions1279340
++Node: Accessing The Source1280265
++Node: Adding Code1281702
++Node: New Ports1287921
++Node: Derived Files1292296
++Ref: Derived Files-Footnote-11297956
++Ref: Derived Files-Footnote-21297991
++Ref: Derived Files-Footnote-31298589
++Node: Future Extensions1298703
++Node: Implementation Limitations1299361
++Node: Extension Design1300571
++Node: Old Extension Problems1301715
++Ref: Old Extension Problems-Footnote-11303233
++Node: Extension New Mechanism Goals1303290
++Ref: Extension New Mechanism Goals-Footnote-11306654
++Node: Extension Other Design Decisions1306843
++Node: Extension Future Growth1308956
++Node: Notes summary1309562
++Node: Basic Concepts1310720
++Node: Basic High Level1311401
++Ref: figure-general-flow1311683
++Ref: figure-process-flow1312368
++Ref: Basic High Level-Footnote-11315669
++Node: Basic Data Typing1315854
++Node: Glossary1319182
++Node: Copying1351067
++Node: GNU Free Documentation License1388610
++Node: Index1413730
End Tag Table
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2c53d8349f3e5abdbbcd8168ac284c5989b4f444
commit 2c53d8349f3e5abdbbcd8168ac284c5989b4f444
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Mar 30 17:14:06 2021 +0300
Update rwarray extension for bool values, and also test code.
diff --git a/extension/ChangeLog b/extension/ChangeLog
index cf58064..986a835 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray.c (write_value): Add support for writing boolean values.
+ (read_value): Ditto.
+
2021-03-29 Arnold D. Robbins <arnold@skeeve.com>
* testext.c (var_test): Fix a comment. Update copyright year.
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 45f9c73..a534a5a 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2009-2014, 2017, 2018, 2020 the Free Software Foundation, Inc.
+ * Copyright (C) 2009-2014, 2017, 2018, 2020, 2021 the Free Software
Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -36,6 +36,7 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -249,6 +250,9 @@ write_value(FILE *fp, awk_value_t *val)
case AWK_UNDEFINED:
code = htonl(5);
break;
+ case AWK_BOOL:
+ code = htonl(6);
+ break;
default:
/* XXX can this happen? */
code = htonl(0);
@@ -258,13 +262,25 @@ write_value(FILE *fp, awk_value_t *val)
if (fwrite(& code, 1, sizeof(code), fp) != sizeof(code))
return awk_false;
- len = htonl(val->str_value.len);
- if (fwrite(& len, 1, sizeof(len), fp) != sizeof(len))
- return awk_false;
+ if (code == ntohl(6)) {
+ len = (val->bool_value == awk_true ? 4 : 5);
+ len = htonl(len);
+ const char *s = (val->bool_value == awk_true ? "TRUE" :
"FALSE");
- if (fwrite(val->str_value.str, 1, val->str_value.len, fp)
- != (ssize_t) val->str_value.len)
- return awk_false;
+ if (fwrite(& len, 1, sizeof(len), fp) != sizeof(len))
+ return awk_false;
+
+ if (fwrite(s, 1, strlen(s), fp) != (ssize_t) strlen(s))
+ return awk_false;
+ } else {
+ len = htonl(val->str_value.len);
+ if (fwrite(& len, 1, sizeof(len), fp) != sizeof(len))
+ return awk_false;
+
+ if (fwrite(val->str_value.str, 1, val->str_value.len,
fp)
+ != (ssize_t) val->str_value.len)
+ return awk_false;
+ }
}
return awk_true;
@@ -484,6 +500,9 @@ read_value(FILE *fp, awk_value_t *value)
case 5:
value->val_type = AWK_UNDEFINED;
break;
+ case 6:
+ value->val_type = AWK_BOOL;
+ break;
default:
/* this cannot happen! */
warning(ext_id, _("treating recovered value with
unknown type code %d as a string"), code);
@@ -498,6 +517,13 @@ read_value(FILE *fp, awk_value_t *value)
return awk_false;
}
value->str_value.str[len] = '\0';
+ value->str_value.len = len;
+ if (code == 6) {
+ /* bool type */
+ bool val = (strcmp(value->str_value.str, "TRUE") == 0);
+ gawk_free(value->str_value.str);
+ value->bool_value = val ? awk_true : awk_false;
+ }
}
return awk_true;
diff --git a/test/ChangeLog b/test/ChangeLog
index 0212e1f..a65ff61 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,7 @@
* Makefile.am (EXTRA_DIST): asortbool, new test.
* asortbool.awk, asortbool.ok: New files.
+ * rwarray.awk: Add test of saving/restoring bool values.
2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/test/rwarray.awk b/test/rwarray.awk
index 86a4b58..831f17c 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -11,6 +11,9 @@ BEGIN {
split("-2.4", f)
dict[strnum_sub] = f[1]
+ bool_sub = "bool-sub"
+ dict[bool_sub] = bool(1)
+
n = asorti(dict, dictindices)
for (i = 1; i <= n; i++)
printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]])
> "orig.out"
@@ -51,4 +54,12 @@ BEGIN {
if (typeof(dict[strnum_sub]) != "strnum")
printf("dict[\"%s\"] should be strnum, is %s\n",
strnum_sub, typeof(dict[strnum_sub]));
+
+ if (typeof(dict[bool_sub]) != "bool")
+ printf("dict[\"%s\"] should be bool, is %s\n",
+ bool_sub, typeof(dict[bool_sub]));
+
+ if ((dict[bool_sub] "") != "TRUE")
+ printf("dict[\"%s\"] should be TRUE, is %s\n",
+ bool_sub, dict[bool_sub]);
}
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=5887e22adfed809e482da3a6f5b2f37901915aff
commit 5887e22adfed809e482da3a6f5b2f37901915aff
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Mar 30 16:40:34 2021 +0300
Finish updating API code for bool.
diff --git a/ChangeLog b/ChangeLog
index 3682123..e4843cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk_api.h (gawk_api_minor_version): Increase to 2.
+ * gawk_api.c (+assign_bool): New function.
+ (node_to_awk_value): Finish updating for bool types and values.
+
2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (make_bool): New inline function.
diff --git a/gawkapi.c b/gawkapi.c
index 929c36b..e8a9c31 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -535,6 +535,16 @@ assign_regex(NODE *node, awk_value_t *val)
val->val_type = AWK_REGEX;
}
+/* assign_bool --- return a bool node */
+
+static inline void
+assign_bool(NODE *node, awk_value_t *val)
+{
+ assert((node->flags & BOOL) != 0);
+ val->val_type = AWK_BOOL;
+ val->bool_value = get_number_si(node) != 0 ? awk_true : awk_false;
+}
+
/* node_to_awk_value --- convert a node into a value for an extension */
static awk_bool_t
@@ -572,18 +582,15 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
switch (wanted) {
case AWK_BOOL:
if ((node->flags & BOOL) != 0) {
- val->val_type = AWK_BOOL;
- val->bool_value = (get_number_si(node) ?
awk_true : awk_false);
+ assign_bool(node, val);
ret = awk_true;
- } else {
+ } else
ret = awk_false;
- }
break;
+
case AWK_NUMBER:
if ((node->flags & REGEX) != 0)
val->val_type = AWK_REGEX;
- else if ((node->flags & BOOL) != 0)
- val->val_type = AWK_BOOL;
else {
(void) force_number(node);
assign_number(node, val);
@@ -693,8 +700,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
/* return true and actual type for request of undefined
*/
switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
case BOOL:
- val->val_type = AWK_BOOL;
- val->bool_value = (get_number_si(node) ?
awk_true : awk_false);
+ assign_bool(node, val);
ret = awk_true;
break;
case STRING:
diff --git a/gawkapi.h b/gawkapi.h
index 6923360..9967aa2 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -297,7 +297,7 @@ typedef struct awk_two_way_processor {
} awk_two_way_processor_t;
#define gawk_api_major_version 3
-#define gawk_api_minor_version 1
+#define gawk_api_minor_version 2
/* Current version of the API. */
enum {
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4561382e8ee7cb0ca0f03e817467973d428260b3
commit 4561382e8ee7cb0ca0f03e817467973d428260b3
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Mar 30 16:33:32 2021 +0300
Update pc/Makefile.tst.
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 399dcc9..51b367d 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Rebuilt.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Rebuilt.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 573981f..f2293ac 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -190,7 +190,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort arraysort2
\
- arraytype \
+ arraytype asortbool \
backw badargs beginfile1 beginfile2 binmode1 \
charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \
clos1way6 crlf \
@@ -2586,6 +2586,11 @@ arraytype:
then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
+asortbool:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
backw:
@echo $@
@echo Expect $@ to fail with DJGPP.
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49
commit edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Tue Mar 30 15:26:58 2021 +0300
Add asort with booleans test.
diff --git a/test/ChangeLog b/test/ChangeLog
index 2604c27..0212e1f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): asortbool, new test.
+ * asortbool.awk, asortbool.ok: New files.
+
2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
* dumpvars.ok, functab5.ok, id.ok, intest.awk, symtab11.ok,
diff --git a/test/Makefile.am b/test/Makefile.am
index bdb8831..0c56b7e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -133,6 +133,8 @@ EXTRA_DIST = \
assignnumfield.ok \
assignnumfield2.awk \
assignnumfield2.ok \
+ asortbool.awk \
+ asortbool.ok \
awkpath.ok \
back89.awk \
back89.in \
@@ -1430,7 +1432,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort arraysort2
\
- arraytype \
+ arraytype asortbool \
backw badargs beginfile1 beginfile2 binmode1 \
charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \
clos1way6 crlf \
diff --git a/test/Makefile.in b/test/Makefile.in
index 92ef9d0..fa823d0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -396,6 +396,8 @@ EXTRA_DIST = \
assignnumfield.ok \
assignnumfield2.awk \
assignnumfield2.ok \
+ asortbool.awk \
+ asortbool.ok \
awkpath.ok \
back89.awk \
back89.in \
@@ -1693,7 +1695,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort arraysort2
\
- arraytype \
+ arraytype asortbool \
backw badargs beginfile1 beginfile2 binmode1 \
charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \
clos1way6 crlf \
@@ -4265,6 +4267,11 @@ arraytype:
then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
+asortbool:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
backw:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 20ed4a7..d3c4a23 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1330,6 +1330,11 @@ arraytype:
then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
+asortbool:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
backw:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
diff --git a/test/asortbool.awk b/test/asortbool.awk
new file mode 100644
index 0000000..7f5a94f
--- /dev/null
+++ b/test/asortbool.awk
@@ -0,0 +1,19 @@
+BEGIN {
+ a[1] = "foo"
+ a[2] = -45
+ a[3] = 45
+ a[4][1] = 47
+ a[5] = bool(1)
+ a[6] = bool(0)
+
+ asort(a, b, "@val_type_asc")
+
+ j = length(b)
+ for (i = 1; i <= j; i++) {
+ printf("%d, %s: ", i, typeof(b[i]))
+ if (isarray(b[i]))
+ print b[i][1]
+ else
+ print b[i]
+ }
+}
diff --git a/test/asortbool.ok b/test/asortbool.ok
new file mode 100644
index 0000000..de08a77
--- /dev/null
+++ b/test/asortbool.ok
@@ -0,0 +1,6 @@
+1, bool: FALSE
+2, bool: TRUE
+3, number: -45
+4, number: 45
+5, string: foo
+6, array: 47
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f021dfc21ac0a96270afbdcf9498b14e95619e6f
commit f021dfc21ac0a96270afbdcf9498b14e95619e6f
Merge: 1fc3d1c 559ea39
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon Mar 29 10:09:05 2021 +0300
Merge branch 'master' into feature/bool
diff --cc extension/ChangeLog
index 053adcd,fef3233..cf58064
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@@ -1,7 -1,7 +1,11 @@@
+ 2021-03-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (var_test): Fix a comment. Update copyright year.
+
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (valrep2str): Add support for AWK_BOOL.
+
2020-07-26 Arnold D. Robbins <arnold@skeeve.com>
* intdiv.c (do_intdiv): Change quotient and remainder to
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1fc3d1cbc5c31ecd7b232e8845530ce6a6760986
commit 1fc3d1cbc5c31ecd7b232e8845530ce6a6760986
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon Mar 22 16:33:36 2021 +0200
Progress on extension support for boolean types.
diff --git a/ChangeLog b/ChangeLog
index 5f0bef1..3682123 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h (make_bool): New inline function.
+ Update table of request/return types.
+ * gawkapi.c (awk_value_to_node): Add support for AWK_BOOL.
+ (node_to_awk_value): Start on same. Not yet complete.
+
2021-03-21 Arnold D. Robbins <arnold@skeeve.com>
* str_array.c (fnv1a_hash_string): New function.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 3dd82e0..748f24f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Constructor Functions): Add doc on `make_bool'.
+
2021-03-21 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Other Environment Variables): Document "fnv1a"
diff --git a/doc/gawk.info b/doc/gawk.info
index 445d06d..1337e0e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -25483,7 +25483,8 @@ use them.
' AWK_STRNUM,'
' AWK_ARRAY,'
' AWK_SCALAR, /* opaque access to a variable */'
-' AWK_VALUE_COOKIE /* for updating a previously created value */'
+' AWK_VALUE_COOKIE, /* for updating a previously created value */'
+' AWK_BOOL'
'} awk_valtype_t;'
This 'enum' indicates the type of a value. It is used in the
following 'struct'.
@@ -25496,6 +25497,7 @@ use them.
' awk_array_t a;'
' awk_scalar_t scl;'
' awk_value_cookie_t vc;'
+' awk_bool_t b;'
' } u;'
'} awk_value_t;'
An "'awk' value." The 'val_type' member indicates what kind of
@@ -25511,6 +25513,7 @@ use them.
'#define array_cookie u.a'
'#define scalar_cookie u.scl'
'#define value_cookie u.vc'
+'#define bool_value u.b'
Using these macros makes accessing the fields of the 'awk_value_t'
more readable.
@@ -25821,6 +25824,11 @@ code would use them:
a 'char *' value pointing to data previously obtained from
'gawk_malloc()', 'gawk_calloc()', or 'gawk_realloc()'.
+'static inline awk_value_t *'
+'make_bool(awk_bool_t boolval, awk_value_t *result);'
+ This function creates a boolean value in the 'awk_value_t' variable
+ pointed to by 'result'.
+
File: gawk.info, Node: API Ownership of MPFR and GMP Values, Next:
Registration Functions, Prev: Constructor Functions, Up: Extension API
Description
@@ -26546,16 +26554,17 @@ summarized in *note Table 17.2:
table-value-types-returned.
Type of Actual Value
--------------------------------------------------------------------------
- String Strnum Number Regex Array Undefined
--------------------------------------------------------------------------------
- String String String String String false false
- Strnum false Strnum Strnum false false false
- Number Number Number Number false false false
-Type Regex false false false Regex false false
-Requested Array false false false false Array false
- Scalar Scalar Scalar Scalar Scalar false false
- Undefined String Strnum Number Regex Array Undefined
- Value false false false false false false
+ String Strnum Number Regex Bool Array
Undefined
+----------------------------------------------------------------------------------------
+ String String String String String String false
false
+ Strnum false Strnum Strnum false false false
false
+ Number Number Number Number false Number false
false
+Type Regex false false false Regex false false
false
+Requested Bool false false false false Bool false
false
+ Array false false false false false Array
false
+ Scalar Scalar Scalar Scalar Scalar Scalar false
false
+ Undefined String Strnum Number Regex Bool Array
Undefined
+ Value false false false false false false
false
cookie
Table 17.2: API value types returned
@@ -38532,145 +38541,145 @@ Node: Extension API Description1022630
Node: Extension API Functions Introduction1024343
Ref: table-api-std-headers1026179
Node: General Data Types1030428
-Ref: General Data Types-Footnote-11039058
-Node: Memory Allocation Functions1039357
-Ref: Memory Allocation Functions-Footnote-11043858
-Node: Constructor Functions1043957
-Node: API Ownership of MPFR and GMP Values1047423
-Node: Registration Functions1048736
-Node: Extension Functions1049436
-Node: Exit Callback Functions1054758
-Node: Extension Version String1056008
-Node: Input Parsers1056671
-Node: Output Wrappers1069392
-Node: Two-way processors1073904
-Node: Printing Messages1076169
-Ref: Printing Messages-Footnote-11077340
-Node: Updating ERRNO1077493
-Node: Requesting Values1078232
-Ref: table-value-types-returned1078969
-Node: Accessing Parameters1079905
-Node: Symbol Table Access1081142
-Node: Symbol table by name1081654
-Ref: Symbol table by name-Footnote-11084678
-Node: Symbol table by cookie1084806
-Ref: Symbol table by cookie-Footnote-11088991
-Node: Cached values1089055
-Ref: Cached values-Footnote-11092591
-Node: Array Manipulation1092744
-Ref: Array Manipulation-Footnote-11093835
-Node: Array Data Types1093872
-Ref: Array Data Types-Footnote-11096530
-Node: Array Functions1096622
-Node: Flattening Arrays1101120
-Node: Creating Arrays1108096
-Node: Redirection API1112863
-Node: Extension API Variables1115696
-Node: Extension Versioning1116407
-Ref: gawk-api-version1116836
-Node: Extension GMP/MPFR Versioning1118567
-Node: Extension API Informational Variables1120195
-Node: Extension API Boilerplate1121268
-Node: Changes from API V11125242
-Node: Finding Extensions1126814
-Node: Extension Example1127373
-Node: Internal File Description1128171
-Node: Internal File Ops1132251
-Ref: Internal File Ops-Footnote-11143601
-Node: Using Internal File Ops1143741
-Ref: Using Internal File Ops-Footnote-11146124
-Node: Extension Samples1146398
-Node: Extension Sample File Functions1147927
-Node: Extension Sample Fnmatch1155576
-Node: Extension Sample Fork1157063
-Node: Extension Sample Inplace1158281
-Node: Extension Sample Ord1161907
-Node: Extension Sample Readdir1162743
-Ref: table-readdir-file-types1163632
-Node: Extension Sample Revout1164699
-Node: Extension Sample Rev2way1165288
-Node: Extension Sample Read write array1166028
-Node: Extension Sample Readfile1167970
-Node: Extension Sample Time1169065
-Node: Extension Sample API Tests1170817
-Node: gawkextlib1171309
-Node: Extension summary1174227
-Node: Extension Exercises1177929
-Node: Language History1179171
-Node: V7/SVR3.11180827
-Node: SVR41182979
-Node: POSIX1184413
-Node: BTL1185794
-Node: POSIX/GNU1186523
-Node: Feature History1192301
-Node: Common Extensions1208620
-Node: Ranges and Locales1209903
-Ref: Ranges and Locales-Footnote-11214519
-Ref: Ranges and Locales-Footnote-21214546
-Ref: Ranges and Locales-Footnote-31214781
-Node: Contributors1215004
-Node: History summary1221001
-Node: Installation1222381
-Node: Gawk Distribution1223325
-Node: Getting1223809
-Node: Extracting1224772
-Node: Distribution contents1226410
-Node: Unix Installation1232890
-Node: Quick Installation1233572
-Node: Shell Startup Files1235986
-Node: Additional Configuration Options1237075
-Node: Configuration Philosophy1239390
-Node: Non-Unix Installation1241759
-Node: PC Installation1242219
-Node: PC Binary Installation1243057
-Node: PC Compiling1243492
-Node: PC Using1244609
-Node: Cygwin1248162
-Node: MSYS1249386
-Node: VMS Installation1249988
-Node: VMS Compilation1250779
-Ref: VMS Compilation-Footnote-11252008
-Node: VMS Dynamic Extensions1252066
-Node: VMS Installation Details1253751
-Node: VMS Running1256004
-Node: VMS GNV1260283
-Node: VMS Old Gawk1261018
-Node: Bugs1261489
-Node: Bug address1262152
-Node: Usenet1265134
-Node: Maintainers1266138
-Node: Other Versions1267323
-Node: Installation summary1275188
-Node: Notes1276397
-Node: Compatibility Mode1277191
-Node: Additions1277973
-Node: Accessing The Source1278898
-Node: Adding Code1280335
-Node: New Ports1286554
-Node: Derived Files1290929
-Ref: Derived Files-Footnote-11296589
-Ref: Derived Files-Footnote-21296624
-Ref: Derived Files-Footnote-31297222
-Node: Future Extensions1297336
-Node: Implementation Limitations1297994
-Node: Extension Design1299204
-Node: Old Extension Problems1300348
-Ref: Old Extension Problems-Footnote-11301866
-Node: Extension New Mechanism Goals1301923
-Ref: Extension New Mechanism Goals-Footnote-11305287
-Node: Extension Other Design Decisions1305476
-Node: Extension Future Growth1307589
-Node: Notes summary1308195
-Node: Basic Concepts1309353
-Node: Basic High Level1310034
-Ref: figure-general-flow1310316
-Ref: figure-process-flow1311001
-Ref: Basic High Level-Footnote-11314302
-Node: Basic Data Typing1314487
-Node: Glossary1317815
-Node: Copying1349700
-Node: GNU Free Documentation License1387243
-Node: Index1412363
+Ref: General Data Types-Footnote-11039134
+Node: Memory Allocation Functions1039433
+Ref: Memory Allocation Functions-Footnote-11043934
+Node: Constructor Functions1044033
+Node: API Ownership of MPFR and GMP Values1047686
+Node: Registration Functions1048999
+Node: Extension Functions1049699
+Node: Exit Callback Functions1055021
+Node: Extension Version String1056271
+Node: Input Parsers1056934
+Node: Output Wrappers1069655
+Node: Two-way processors1074167
+Node: Printing Messages1076432
+Ref: Printing Messages-Footnote-11077603
+Node: Updating ERRNO1077756
+Node: Requesting Values1078495
+Ref: table-value-types-returned1079232
+Node: Accessing Parameters1080340
+Node: Symbol Table Access1081577
+Node: Symbol table by name1082089
+Ref: Symbol table by name-Footnote-11085113
+Node: Symbol table by cookie1085241
+Ref: Symbol table by cookie-Footnote-11089426
+Node: Cached values1089490
+Ref: Cached values-Footnote-11093026
+Node: Array Manipulation1093179
+Ref: Array Manipulation-Footnote-11094270
+Node: Array Data Types1094307
+Ref: Array Data Types-Footnote-11096965
+Node: Array Functions1097057
+Node: Flattening Arrays1101555
+Node: Creating Arrays1108531
+Node: Redirection API1113298
+Node: Extension API Variables1116131
+Node: Extension Versioning1116842
+Ref: gawk-api-version1117271
+Node: Extension GMP/MPFR Versioning1119002
+Node: Extension API Informational Variables1120630
+Node: Extension API Boilerplate1121703
+Node: Changes from API V11125677
+Node: Finding Extensions1127249
+Node: Extension Example1127808
+Node: Internal File Description1128606
+Node: Internal File Ops1132686
+Ref: Internal File Ops-Footnote-11144036
+Node: Using Internal File Ops1144176
+Ref: Using Internal File Ops-Footnote-11146559
+Node: Extension Samples1146833
+Node: Extension Sample File Functions1148362
+Node: Extension Sample Fnmatch1156011
+Node: Extension Sample Fork1157498
+Node: Extension Sample Inplace1158716
+Node: Extension Sample Ord1162342
+Node: Extension Sample Readdir1163178
+Ref: table-readdir-file-types1164067
+Node: Extension Sample Revout1165134
+Node: Extension Sample Rev2way1165723
+Node: Extension Sample Read write array1166463
+Node: Extension Sample Readfile1168405
+Node: Extension Sample Time1169500
+Node: Extension Sample API Tests1171252
+Node: gawkextlib1171744
+Node: Extension summary1174662
+Node: Extension Exercises1178364
+Node: Language History1179606
+Node: V7/SVR3.11181262
+Node: SVR41183414
+Node: POSIX1184848
+Node: BTL1186229
+Node: POSIX/GNU1186958
+Node: Feature History1192736
+Node: Common Extensions1209055
+Node: Ranges and Locales1210338
+Ref: Ranges and Locales-Footnote-11214954
+Ref: Ranges and Locales-Footnote-21214981
+Ref: Ranges and Locales-Footnote-31215216
+Node: Contributors1215439
+Node: History summary1221436
+Node: Installation1222816
+Node: Gawk Distribution1223760
+Node: Getting1224244
+Node: Extracting1225207
+Node: Distribution contents1226845
+Node: Unix Installation1233325
+Node: Quick Installation1234007
+Node: Shell Startup Files1236421
+Node: Additional Configuration Options1237510
+Node: Configuration Philosophy1239825
+Node: Non-Unix Installation1242194
+Node: PC Installation1242654
+Node: PC Binary Installation1243492
+Node: PC Compiling1243927
+Node: PC Using1245044
+Node: Cygwin1248597
+Node: MSYS1249821
+Node: VMS Installation1250423
+Node: VMS Compilation1251214
+Ref: VMS Compilation-Footnote-11252443
+Node: VMS Dynamic Extensions1252501
+Node: VMS Installation Details1254186
+Node: VMS Running1256439
+Node: VMS GNV1260718
+Node: VMS Old Gawk1261453
+Node: Bugs1261924
+Node: Bug address1262587
+Node: Usenet1265569
+Node: Maintainers1266573
+Node: Other Versions1267758
+Node: Installation summary1275623
+Node: Notes1276832
+Node: Compatibility Mode1277626
+Node: Additions1278408
+Node: Accessing The Source1279333
+Node: Adding Code1280770
+Node: New Ports1286989
+Node: Derived Files1291364
+Ref: Derived Files-Footnote-11297024
+Ref: Derived Files-Footnote-21297059
+Ref: Derived Files-Footnote-31297657
+Node: Future Extensions1297771
+Node: Implementation Limitations1298429
+Node: Extension Design1299639
+Node: Old Extension Problems1300783
+Ref: Old Extension Problems-Footnote-11302301
+Node: Extension New Mechanism Goals1302358
+Ref: Extension New Mechanism Goals-Footnote-11305722
+Node: Extension Other Design Decisions1305911
+Node: Extension Future Growth1308024
+Node: Notes summary1308630
+Node: Basic Concepts1309788
+Node: Basic High Level1310469
+Ref: figure-general-flow1310751
+Ref: figure-process-flow1311436
+Ref: Basic High Level-Footnote-11314737
+Node: Basic Data Typing1314922
+Node: Glossary1318250
+Node: Copying1350135
+Node: GNU Free Documentation License1387678
+Node: Index1412798
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index b472316..7e0a7a9 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -35488,7 +35488,8 @@ multibyte encoding.
@itemx @ @ @ @ AWK_STRNUM,
@itemx @ @ @ @ AWK_ARRAY,
@itemx @ @ @ @ AWK_SCALAR,@ @ @ @ @ @ @ @ @ /* opaque access to a variable */
-@itemx @ @ @ @ AWK_VALUE_COOKIE@ @ @ @ /* for updating a previously created
value */
+@itemx @ @ @ @ AWK_VALUE_COOKIE,@ @ @ /* for updating a previously created
value */
+@itemx @ @ @ @ AWK_BOOL
@itemx @} awk_valtype_t;
This @code{enum} indicates the type of a value.
It is used in the following @code{struct}.
@@ -35501,6 +35502,7 @@ It is used in the following @code{struct}.
@itemx @ @ @ @ @ @ @ @ awk_array_t@ @ @ @ @ @ @ @ a;
@itemx @ @ @ @ @ @ @ @ awk_scalar_t@ @ @ @ @ @ @ scl;
@itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc;
+@itemx @ @ @ @ @ @ @ @ awk_bool_t@ @ @ @ @ @ @ @ @ b;
@itemx @ @ @ @ @} u;
@itemx @} awk_value_t;
An ``@command{awk} value.''
@@ -35516,6 +35518,7 @@ The @code{val_type} member indicates what kind of value
the
@itemx #define array_cookie@ @ @ u.a
@itemx #define scalar_cookie@ @ u.scl
@itemx #define value_cookie@ @ @ u.vc
+@itemx #define bool_value@ @ @ @ @ u.b
Using these macros makes accessing the fields of the @code{awk_value_t} more
readable.
@@ -35843,6 +35846,11 @@ the regular expression of length @code{len}. It
expects @code{string}
to be a @samp{char *} value pointing to data previously obtained from
@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}.
+@item static inline awk_value_t *
+@itemx make_bool(awk_bool_t boolval, awk_value_t *result);
+This function creates a boolean value in the @code{awk_value_t} variable
+pointed to by @code{result}.
+
@end table
@node API Ownership of MPFR and GMP Values
@@ -36643,7 +36651,8 @@ value type, as appropriate. This behavior is
summarized in
<colspec colname="c6"/>
<colspec colname="c7"/>
<colspec colname="c8"/>
- <spanspec spanname="hspan" namest="c3" nameend="c8" align="center"/>
+ <colspec colname="c9"/>
+ <spanspec spanname="hspan" namest="c3" nameend="c9" align="center"/>
<thead>
<row><entry></entry><entry spanname="hspan"><para>Type of Actual
Value</para></entry></row>
<row>
@@ -36653,6 +36662,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Strnum</para></entry>
<entry><para>Number</para></entry>
<entry><para>Regex</para></entry>
+ <entry><para>Bool</para></entry>
<entry><para>Array</para></entry>
<entry><para>Undefined</para></entry>
</row>
@@ -36665,6 +36675,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>String</para></entry>
<entry><para>String</para></entry>
<entry><para>String</para></entry>
+ <entry><para>String</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -36677,6 +36688,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
</row>
<row>
<entry></entry>
@@ -36685,6 +36697,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Number</para></entry>
<entry><para>Number</para></entry>
<entry><para>false</para></entry>
+ <entry><para>Number</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -36693,6 +36706,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para><emphasis role="bold">Regex</emphasis></para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
<entry><para>Regex</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
@@ -36700,11 +36714,23 @@ value type, as appropriate. This behavior is
summarized in
</row>
<row>
<entry><para><emphasis role="bold">Requested</emphasis></para></entry>
+ <entry><para><emphasis role="bold">Bool</emphasis></para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>Bool</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ </row>
+ <row>
+ <entry><para></para></entry>
<entry><para><emphasis role="bold">Array</emphasis></para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
<entry><para>Array</para></entry>
<entry><para>false</para></entry>
</row>
@@ -36715,6 +36741,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Scalar</para></entry>
<entry><para>Scalar</para></entry>
<entry><para>Scalar</para></entry>
+ <entry><para>Scalar</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -36725,6 +36752,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Strnum</para></entry>
<entry><para>Number</para></entry>
<entry><para>Regex</para></entry>
+ <entry><para>Bool</para></entry>
<entry><para>Array</para></entry>
<entry><para>Undefined</para></entry>
</row>
@@ -36737,6 +36765,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
</row>
</tbody>
</tgroup>
@@ -36753,43 +36782,46 @@ value type, as appropriate. This behavior is
summarized in
\vglue-1.1\baselineskip
@end tex
@c @multitable @columnfractions .166 .166 .198 .15 .15 .166
-@multitable {Requested} {Undefined} {Number} {Number} {Scalar} {Regex} {Array}
{Undefined}
-@headitem @tab @tab String @tab Strnum @tab Number @tab Regex @tab Array @tab
Undefined
-@item @tab @b{String} @tab String @tab String @tab String @tab String @tab
false @tab false
-@item @tab @b{Strnum} @tab false @tab Strnum @tab Strnum @tab false @tab false
@tab false
-@item @tab @b{Number} @tab Number @tab Number @tab Number @tab false @tab
false @tab false
-@item @b{Type} @tab @b{Regex} @tab false @tab false @tab false @tab Regex @tab
false @tab false
-@item @b{Requested} @tab @b{Array} @tab false @tab false @tab false @tab false
@tab Array @tab false
-@item @tab @b{Scalar} @tab Scalar @tab Scalar @tab Scalar @tab Scalar @tab
false @tab false
-@item @tab @b{Undefined} @tab String @tab Strnum @tab Number @tab Regex @tab
Array @tab Undefined
-@item @tab @b{Value cookie} @tab false @tab false @tab false @tab false @tab
false @tab false
+@multitable {Requested} {Undefined} {Number} {Number} {Scalar} {Regex}
{Number} {Array} {Undefined}
+@headitem @tab @tab String @tab Strnum @tab Number @tab Regex @tab Bool @tab
Array @tab Undefined
+@item @tab @b{String} @tab String @tab String @tab String @tab String @tab
String @tab false @tab false
+@item @tab @b{Strnum} @tab false @tab Strnum @tab Strnum @tab false @tab false
@tab false @tab false
+@item @tab @b{Number} @tab Number @tab Number @tab Number @tab false @tab
Number @tab false @tab false
+@item @b{Type} @tab @b{Regex} @tab false @tab false @tab false @tab Regex @tab
false @tab false @tab false
+@item @b{Requested} @tab @b{Bool} @tab false @tab false @tab false @tab false
@tab Bool @tab false @tab false
+@item @tab @b{Array} @tab false @tab false @tab false @tab false @tab false
@tab Array @tab false
+@item @tab @b{Scalar} @tab Scalar @tab Scalar @tab Scalar @tab Scalar @tab
Scalar @tab false @tab false
+@item @tab @b{Undefined} @tab String @tab Strnum @tab Number @tab Regex @tab
Bool @tab Array @tab Undefined
+@item @tab @b{Value cookie} @tab false @tab false @tab false @tab false @tab
false @tab false @tab false
@end multitable
@end ifnotdocbook
@end ifnotplaintext
@ifplaintext
@verbatim
-
+-------------------------------------------------------+
- | Type of Actual Value:
|
-
+--------+--------+--------+--------+-------+-----------+
- | String | Strnum | Number | Regex | Array |
Undefined |
-+-----------+-----------+--------+--------+--------+--------+-------+-----------+
-| | String | String | String | String | String | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Strnum | false | Strnum | Strnum | false | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Number | Number | Number | Number | false | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Regex | false | false | false | Regex | false | false
|
-| Type
+-----------+--------+--------+--------+--------+-------+-----------+
-| Requested | Array | false | false | false | false | Array | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Scalar | Scalar | Scalar | Scalar | Scalar | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Undefined | String | Strnum | Number | Regex | Array |
Undefined |
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Value | false | false | false | false | false | false
|
-| | Cookie | | | | | |
|
-+-----------+-----------+--------+--------+--------+--------+-------+-----------+
+
+----------------------------------------------------------------+
+ | Type of Actual Value:
|
+
+--------+--------+--------+--------+--------+-------+-----------+
+ | String | Strnum | Number | Regex | Bool | Array |
Undefined |
++-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | String | String | String | String | String | String | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Strnum | false | Strnum | Strnum | false | false | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Number | Number | Number | Number | false | Number | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Regex | false | false | false | Regex | false | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| Type | Bool | false | false | false | false | Bool | false |
false |
+| Requested
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Array | false | false | false | false | false | Array |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Scalar | Scalar | Scalar | Scalar | Scalar | Scalar | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Undefined | String | Strnum | Number | Regex | Bool | Array |
Undefined |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Value | false | false | false | false | false | false |
false |
+| | Cookie | | | | | | |
|
++-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
@end verbatim
@end ifplaintext
@end float
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 2c2d729..228ea0d 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -34385,7 +34385,8 @@ multibyte encoding.
@itemx @ @ @ @ AWK_STRNUM,
@itemx @ @ @ @ AWK_ARRAY,
@itemx @ @ @ @ AWK_SCALAR,@ @ @ @ @ @ @ @ @ /* opaque access to a variable */
-@itemx @ @ @ @ AWK_VALUE_COOKIE@ @ @ @ /* for updating a previously created
value */
+@itemx @ @ @ @ AWK_VALUE_COOKIE,@ @ @ /* for updating a previously created
value */
+@itemx @ @ @ @ AWK_BOOL
@itemx @} awk_valtype_t;
This @code{enum} indicates the type of a value.
It is used in the following @code{struct}.
@@ -34398,6 +34399,7 @@ It is used in the following @code{struct}.
@itemx @ @ @ @ @ @ @ @ awk_array_t@ @ @ @ @ @ @ @ a;
@itemx @ @ @ @ @ @ @ @ awk_scalar_t@ @ @ @ @ @ @ scl;
@itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc;
+@itemx @ @ @ @ @ @ @ @ awk_bool_t@ @ @ @ @ @ @ @ @ b;
@itemx @ @ @ @ @} u;
@itemx @} awk_value_t;
An ``@command{awk} value.''
@@ -34413,6 +34415,7 @@ The @code{val_type} member indicates what kind of value
the
@itemx #define array_cookie@ @ @ u.a
@itemx #define scalar_cookie@ @ u.scl
@itemx #define value_cookie@ @ @ u.vc
+@itemx #define bool_value@ @ @ @ @ u.b
Using these macros makes accessing the fields of the @code{awk_value_t} more
readable.
@@ -34740,6 +34743,11 @@ the regular expression of length @code{len}. It
expects @code{string}
to be a @samp{char *} value pointing to data previously obtained from
@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}.
+@item static inline awk_value_t *
+@itemx make_bool(awk_bool_t boolval, awk_value_t *result);
+This function creates a boolean value in the @code{awk_value_t} variable
+pointed to by @code{result}.
+
@end table
@node API Ownership of MPFR and GMP Values
@@ -35540,7 +35548,8 @@ value type, as appropriate. This behavior is
summarized in
<colspec colname="c6"/>
<colspec colname="c7"/>
<colspec colname="c8"/>
- <spanspec spanname="hspan" namest="c3" nameend="c8" align="center"/>
+ <colspec colname="c9"/>
+ <spanspec spanname="hspan" namest="c3" nameend="c9" align="center"/>
<thead>
<row><entry></entry><entry spanname="hspan"><para>Type of Actual
Value</para></entry></row>
<row>
@@ -35550,6 +35559,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Strnum</para></entry>
<entry><para>Number</para></entry>
<entry><para>Regex</para></entry>
+ <entry><para>Bool</para></entry>
<entry><para>Array</para></entry>
<entry><para>Undefined</para></entry>
</row>
@@ -35562,6 +35572,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>String</para></entry>
<entry><para>String</para></entry>
<entry><para>String</para></entry>
+ <entry><para>String</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -35574,6 +35585,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
</row>
<row>
<entry></entry>
@@ -35582,6 +35594,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Number</para></entry>
<entry><para>Number</para></entry>
<entry><para>false</para></entry>
+ <entry><para>Number</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -35590,6 +35603,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para><emphasis role="bold">Regex</emphasis></para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
<entry><para>Regex</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
@@ -35597,11 +35611,23 @@ value type, as appropriate. This behavior is
summarized in
</row>
<row>
<entry><para><emphasis role="bold">Requested</emphasis></para></entry>
+ <entry><para><emphasis role="bold">Bool</emphasis></para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>Bool</para></entry>
+ <entry><para>false</para></entry>
+ <entry><para>false</para></entry>
+ </row>
+ <row>
+ <entry><para></para></entry>
<entry><para><emphasis role="bold">Array</emphasis></para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
<entry><para>Array</para></entry>
<entry><para>false</para></entry>
</row>
@@ -35612,6 +35638,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Scalar</para></entry>
<entry><para>Scalar</para></entry>
<entry><para>Scalar</para></entry>
+ <entry><para>Scalar</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
</row>
@@ -35622,6 +35649,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>Strnum</para></entry>
<entry><para>Number</para></entry>
<entry><para>Regex</para></entry>
+ <entry><para>Bool</para></entry>
<entry><para>Array</para></entry>
<entry><para>Undefined</para></entry>
</row>
@@ -35634,6 +35662,7 @@ value type, as appropriate. This behavior is
summarized in
<entry><para>false</para></entry>
<entry><para>false</para></entry>
<entry><para>false</para></entry>
+ <entry><para>false</para></entry>
</row>
</tbody>
</tgroup>
@@ -35650,43 +35679,46 @@ value type, as appropriate. This behavior is
summarized in
\vglue-1.1\baselineskip
@end tex
@c @multitable @columnfractions .166 .166 .198 .15 .15 .166
-@multitable {Requested} {Undefined} {Number} {Number} {Scalar} {Regex} {Array}
{Undefined}
-@headitem @tab @tab String @tab Strnum @tab Number @tab Regex @tab Array @tab
Undefined
-@item @tab @b{String} @tab String @tab String @tab String @tab String @tab
false @tab false
-@item @tab @b{Strnum} @tab false @tab Strnum @tab Strnum @tab false @tab false
@tab false
-@item @tab @b{Number} @tab Number @tab Number @tab Number @tab false @tab
false @tab false
-@item @b{Type} @tab @b{Regex} @tab false @tab false @tab false @tab Regex @tab
false @tab false
-@item @b{Requested} @tab @b{Array} @tab false @tab false @tab false @tab false
@tab Array @tab false
-@item @tab @b{Scalar} @tab Scalar @tab Scalar @tab Scalar @tab Scalar @tab
false @tab false
-@item @tab @b{Undefined} @tab String @tab Strnum @tab Number @tab Regex @tab
Array @tab Undefined
-@item @tab @b{Value cookie} @tab false @tab false @tab false @tab false @tab
false @tab false
+@multitable {Requested} {Undefined} {Number} {Number} {Scalar} {Regex}
{Number} {Array} {Undefined}
+@headitem @tab @tab String @tab Strnum @tab Number @tab Regex @tab Bool @tab
Array @tab Undefined
+@item @tab @b{String} @tab String @tab String @tab String @tab String @tab
String @tab false @tab false
+@item @tab @b{Strnum} @tab false @tab Strnum @tab Strnum @tab false @tab false
@tab false @tab false
+@item @tab @b{Number} @tab Number @tab Number @tab Number @tab false @tab
Number @tab false @tab false
+@item @b{Type} @tab @b{Regex} @tab false @tab false @tab false @tab Regex @tab
false @tab false @tab false
+@item @b{Requested} @tab @b{Bool} @tab false @tab false @tab false @tab false
@tab Bool @tab false @tab false
+@item @tab @b{Array} @tab false @tab false @tab false @tab false @tab false
@tab Array @tab false
+@item @tab @b{Scalar} @tab Scalar @tab Scalar @tab Scalar @tab Scalar @tab
Scalar @tab false @tab false
+@item @tab @b{Undefined} @tab String @tab Strnum @tab Number @tab Regex @tab
Bool @tab Array @tab Undefined
+@item @tab @b{Value cookie} @tab false @tab false @tab false @tab false @tab
false @tab false @tab false
@end multitable
@end ifnotdocbook
@end ifnotplaintext
@ifplaintext
@verbatim
-
+-------------------------------------------------------+
- | Type of Actual Value:
|
-
+--------+--------+--------+--------+-------+-----------+
- | String | Strnum | Number | Regex | Array |
Undefined |
-+-----------+-----------+--------+--------+--------+--------+-------+-----------+
-| | String | String | String | String | String | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Strnum | false | Strnum | Strnum | false | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Number | Number | Number | Number | false | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Regex | false | false | false | Regex | false | false
|
-| Type
+-----------+--------+--------+--------+--------+-------+-----------+
-| Requested | Array | false | false | false | false | Array | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Scalar | Scalar | Scalar | Scalar | Scalar | false | false
|
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Undefined | String | Strnum | Number | Regex | Array |
Undefined |
-|
+-----------+--------+--------+--------+--------+-------+-----------+
-| | Value | false | false | false | false | false | false
|
-| | Cookie | | | | | |
|
-+-----------+-----------+--------+--------+--------+--------+-------+-----------+
+
+----------------------------------------------------------------+
+ | Type of Actual Value:
|
+
+--------+--------+--------+--------+--------+-------+-----------+
+ | String | Strnum | Number | Regex | Bool | Array |
Undefined |
++-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | String | String | String | String | String | String | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Strnum | false | Strnum | Strnum | false | false | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Number | Number | Number | Number | false | Number | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Regex | false | false | false | Regex | false | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| Type | Bool | false | false | false | false | Bool | false |
false |
+| Requested
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Array | false | false | false | false | false | Array |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Scalar | Scalar | Scalar | Scalar | Scalar | Scalar | false |
false |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Undefined | String | Strnum | Number | Regex | Bool | Array |
Undefined |
+|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+| | Value | false | false | false | false | false | false |
false |
+| | Cookie | | | | | | |
|
++-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
@end verbatim
@end ifplaintext
@end float
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 1a01889..053adcd 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (valrep2str): Add support for AWK_BOOL.
+
2020-07-26 Arnold D. Robbins <arnold@skeeve.com>
* intdiv.c (do_intdiv): Change quotient and remainder to
diff --git a/extension/testext.c b/extension/testext.c
index b911ec9..3acfb19 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -88,6 +88,13 @@ valrep2str(const awk_value_t *value)
size,
value->str_value.str);
break;
+ case AWK_BOOL:
+ if (value->str_value.len + 8 < size)
+ size = value->str_value.len;
+ sprintf(buf, "<bool>: %.*s",
+ size,
+ value->str_value.str);
+ break;
case AWK_NUMBER:
sprintf(buf, "%g", value->num_value);
break;
diff --git a/gawkapi.c b/gawkapi.c
index a60549d..929c36b 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -160,6 +160,9 @@ awk_value_to_node(const awk_value_t *retval)
case AWK_UNDEFINED:
ext_ret_val = dupnode(Nnull_string);
break;
+ case AWK_BOOL:
+ ext_ret_val = make_bool_node(retval->bool_value != awk_false);
+ break;
case AWK_NUMBER:
switch (retval->num_type) {
case AWK_NUMBER_TYPE_DOUBLE:
@@ -567,9 +570,20 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case Node_val:
/* a scalar value */
switch (wanted) {
+ case AWK_BOOL:
+ if ((node->flags & BOOL) != 0) {
+ val->val_type = AWK_BOOL;
+ val->bool_value = (get_number_si(node) ?
awk_true : awk_false);
+ ret = awk_true;
+ } else {
+ ret = awk_false;
+ }
+ break;
case AWK_NUMBER:
- if (node->flags & REGEX)
+ if ((node->flags & REGEX) != 0)
val->val_type = AWK_REGEX;
+ else if ((node->flags & BOOL) != 0)
+ val->val_type = AWK_BOOL;
else {
(void) force_number(node);
assign_number(node, val);
@@ -578,7 +592,10 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_STRNUM:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case BOOL:
+ val->val_type = AWK_BOOL;
+ break;
case STRING:
val->val_type = AWK_STRING;
break;
@@ -612,10 +629,13 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_REGEX:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
case STRING:
val->val_type = AWK_STRING;
break;
+ case BOOL:
+ val->val_type = AWK_BOOL;
+ break;
case NUMBER:
val->val_type = AWK_NUMBER;
break;
@@ -640,7 +660,10 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_SCALAR:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case BOOL:
+ val->val_type = AWK_BOOL;
+ break;
case STRING:
val->val_type = AWK_STRING;
break;
@@ -668,7 +691,12 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case AWK_UNDEFINED:
/* return true and actual type for request of undefined
*/
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case BOOL:
+ val->val_type = AWK_BOOL;
+ val->bool_value = (get_number_si(node) ?
awk_true : awk_false);
+ ret = awk_true;
+ break;
case STRING:
assign_string(node, val, AWK_STRING);
ret = awk_true;
diff --git a/gawkapi.h b/gawkapi.h
index 3fd02df..6923360 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -568,8 +568,8 @@ typedef struct gawk_api {
Table entry is type returned:
-
+-------------------------------------------------------+
- | Type of Actual Value:
|
+
+----------------------------------------------------------------+
+ | Type of Actual Value:
|
+--------+--------+--------+--------+--------+-------+-----------+
| String | Strnum | Number | Regex | Bool |
Array | Undefined |
+-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
@@ -581,10 +581,10 @@ typedef struct gawk_api {
|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
| | Regex | false | false | false | Regex | false |
false | false |
|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
- | | Bool | false | false | false | false | Bool |
false | false |
- |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
- | Type | Array | false | false | false | false | false |
Array | false |
+ | Type | Bool | false | false | false | false | Bool |
false | false |
| Requested
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Array | false | false | false | false | false |
Array | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
| | Scalar | Scalar | Scalar | Scalar | Scalar | Scalar |
false | false |
|
+-----------+--------+--------+--------+--------+--------+-------+-----------+
| | Undefined | String | Strnum | Number | Regex | Bool |
Array | Undefined |
@@ -1074,6 +1074,16 @@ make_number_mpfr(void *mpfr_ptr, awk_value_t *result)
return result;
}
+/* make_bool --- make a bool value in result */
+
+static inline awk_value_t *
+make_bool(awk_bool_t boolval, awk_value_t *result)
+{
+ result->val_type = AWK_BOOL;
+ result->bool_value = boolval;
+ return result;
+}
+
/*
* Each extension must define a function with this prototype:
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=efc5713d00a0019eb33c8a61c8a5514da7fa303e
commit efc5713d00a0019eb33c8a61c8a5514da7fa303e
Merge: 8153054 17b9ce3
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Mar 21 21:07:10 2021 +0200
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=81530542f62a575e3857f3a8847c886ee68f9d83
commit 81530542f62a575e3857f3a8847c886ee68f9d83
Merge: 96b65e9 156d925
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Mar 21 11:37:12 2021 +0200
Merge branch 'master' into feature/bool
diff --cc ChangeLog
index 5f2794d,56deef6..5f0bef1
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,35 -1,9 +1,41 @@@
+ 2021-03-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * str_array.c (fnv1a_hash_string): New function.
+ (str_array_init): Use fnv1a_hash_string if AWK_HASH env var
+ set to "fnv1a".
+
+2021-03-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (do_sort_up_value_type): Add logic for handling bools.
+
+2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (warn_bool, do_bool): Add function declarations.
+ * awkgram.y (tokentab): Add entry for "bool" builtin.
+ * builtin.c (warn_bool): New function.
+ (do_index, do_substr, do_toupper, do_tolower, do_match,
+ do_length): Call it.
+ (do_sub): If first arg to sub/gsub is bool, fatal error.
+ (do_bool): New function.
+ * field.c (do_split, do_patsplit): Call warn_bool.
+ * main.c (load_procinfo_bools): Removed function and call.
+
+2021-03-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start on a bool type for gawk.
+
+ * awk.h (BOOL): New flag value.
+ (make_bool_node): Add declaration of new function.
+ (bool_val): Check for BOOL along with NUMBER.
+ * builtin.c (do_typeof): Add support for BOOL.
+ * eval.c (flags2str): Ditto.
+ * gawkapi.h (awk_val_type): Add AWK_BOOL.
+ (awk_value_t): Add awk_bool_t element to the union and macro for it.
+ (struct gawk_api): Update the table of request/return values.
+ * main.c (load_procinfo_bools): New function.
+ (load_procinfo): Call it.
+ * node.c (make_bool_node): New function.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* io.c (nextfile): Use the value of ARGC directly in the for
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=96b65e953d309fb00cc48b3883fc5805898e57e1
commit 96b65e953d309fb00cc48b3883fc5805898e57e1
Merge: e1b7b04 b1c6269
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sat Mar 20 21:39:35 2021 +0200
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=e1b7b04b63a83913f62e4bfff645b940eacf7803
commit e1b7b04b63a83913f62e4bfff645b940eacf7803
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sat Mar 20 21:37:35 2021 +0200
Handle bools for array sorting.
diff --git a/ChangeLog b/ChangeLog
index e248bcc..5f2794d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (do_sort_up_value_type): Add logic for handling bools.
+
2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (warn_bool, do_bool): Add function declarations.
diff --git a/array.c b/array.c
index 50efddb..b4ce86b 100644
--- a/array.c
+++ b/array.c
@@ -1209,11 +1209,24 @@ do_sort_up_value_type(const void *p1, const void *p2)
(void) fixtype(n1);
(void) fixtype(n2);
+ /* 3a. Bools first */
+ if ((n1->flags & BOOL) != 0 && (n2->flags & BOOL) != 0) {
+ return cmp_numbers(n1, n2);
+ }
+
+ /* 3b. Numbers next */
if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) {
return cmp_numbers(n1, n2);
}
- /* 3. All numbers are less than all strings. This is aribitrary. */
+ /* 3c. Bools before everything else */
+ if ((n1->flags & BOOL) != 0 && (n2->flags & BOOL) == 0) {
+ return -1;
+ } else if ((n1->flags & BOOL) == 0 && (n2->flags & BOOL) != 0) {
+ return 1;
+ }
+
+ /* 3d. All numbers are less than all strings. This is aribitrary. */
if ((n1->flags & NUMBER) != 0 && (n2->flags & STRING) != 0) {
return -1;
} else if ((n1->flags & STRING) != 0 && (n2->flags & NUMBER) != 0) {
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=40cd3b0df6128e5b111c9b7c5c9892eac13a3497
commit 40cd3b0df6128e5b111c9b7c5c9892eac13a3497
Merge: a98f6b5 99506ea
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Mar 18 21:21:36 2021 +0200
Merge branch 'master' into feature/bool
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a98f6b507ed2d540ee214cf1f9eb3487a542fd18
commit a98f6b507ed2d540ee214cf1f9eb3487a542fd18
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Mar 18 21:06:15 2021 +0200
Update to bool.notes.
diff --git a/bool.notes b/bool.notes
index df3ec69..8e24c2b 100644
--- a/bool.notes
+++ b/bool.notes
@@ -1,30 +1,31 @@
-Fri Mar 5 13:42:44 IST 2021
+Thu Mar 18 21:05:29 IST 2021
============================
Design Notes for a Boolean Type in Gawk
-1. At first glance, two new variables named TRUE and FALSE would make sense
-to be predefined values of boolean type. However, since it's likely that
-many awk programs already use them, instead we'll add two new entries
-to PROCINFO: variables PROCINFO["true"] and PROCINFO["false"] of type bool.
+1. A new function bool(val) converts val to bool, returning Boolean TRUE
+or FALSE. This is the generator for boolean values and is enough to have
+instead of predefining new variables TRUE and FALSE.
-Assigning from them copies the bool type, thus they are "factories" of bool
-variables.
+2. Assigning from a boolean value copies the bool type.
-2. They have numeric values 1 and 0 respectively, and string values
-"TRUE" and "FALSE". Thus they differ from other variables where a
+3. Boolean variables have numeric values 1 and 0 respectively, and string
+values "TRUE" and "FALSE". Thus they differ from other variables where a
"false" value must be zero and null.
-This implies all of the following:
+Given:
- print(PROCINFO["true"]) --> "TRUE"
- print(PROCINFO["false"]) --> "FALSE"
+ true = bool(1)
+ false = bool(0)
+
+this implies all of the following:
+
+ print(true) --> "TRUE"
+ print(false) --> "FALSE"
Same for %s in printf
Same for bool_var ""
printf %d gives 0/1
-3. Function bool(val) converts val to bool, returning Boolean TRUE or FALSE.
-
4. typeof() returns "bool".
5. Numeric operators treat booleans as numbers. asort() sorts booleans before
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=5fd7d2faf13484c595f7cd74468711282816796d
commit 5fd7d2faf13484c595f7cd74468711282816796d
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Mon Mar 8 18:31:52 2021 +0200
More progress on bool.
diff --git a/ChangeLog b/ChangeLog
index 52b74a7..e248bcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (warn_bool, do_bool): Add function declarations.
+ * awkgram.y (tokentab): Add entry for "bool" builtin.
+ * builtin.c (warn_bool): New function.
+ (do_index, do_substr, do_toupper, do_tolower, do_match,
+ do_length): Call it.
+ (do_sub): If first arg to sub/gsub is bool, fatal error.
+ (do_bool): New function.
+ * field.c (do_split, do_patsplit): Call warn_bool.
+ * main.c (load_procinfo_bools): Removed function and call.
+
2021-03-05 Arnold D. Robbins <arnold@skeeve.com>
Start on a bool type for gawk.
diff --git a/awk.h b/awk.h
index ee055f4..f4fa4d4 100644
--- a/awk.h
+++ b/awk.h
@@ -1455,6 +1455,7 @@ extern bool is_identchar(int c);
extern NODE *make_regnode(NODETYPE type, NODE *exp);
extern bool validate_qualified_name(char *token);
/* builtin.c */
+extern void warn_bool(const char *func, int argnum, NODE *n);
extern double double_to_int(double d);
extern NODE *do_exp(int nargs);
extern NODE *do_fflush(int nargs);
@@ -1504,6 +1505,7 @@ extern int strncasecmpmbs(const unsigned char *,
const unsigned char *, size_t);
extern int sanitize_exit_status(int status);
extern void check_symtab_functab(NODE *dest, const char *fname, const char
*msg);
+extern NODE *do_bool(int nargs);
/* debug.c */
extern void init_debug(void);
extern int debug_prog(INSTRUCTION *pc);
diff --git a/awkgram.c b/awkgram.c
index 9c2700a..40c3cbd 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4779,6 +4779,7 @@ static const struct token tokentab[] = {
{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3),
do_asorti, 0},
{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2,
MPF(atan2)},
{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2),
do_bindtextdomain, 0},
+{"bool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_bool,
0},
{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2),
do_close, 0},
diff --git a/awkgram.y b/awkgram.y
index 6dfbe7e..3fe0272 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -2277,6 +2277,7 @@ static const struct token tokentab[] = {
{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3),
do_asorti, 0},
{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2,
MPF(atan2)},
{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2),
do_bindtextdomain, 0},
+{"bool", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_bool,
0},
{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2),
do_close, 0},
diff --git a/bool.notes b/bool.notes
index 51ea726..df3ec69 100644
--- a/bool.notes
+++ b/bool.notes
@@ -33,8 +33,13 @@ numbers, and false before true.
6. These string function generate a runtime fatal error
if given an argument / target of boolean type:
- substr match index gensub gsub
- sub length split patsplit
+ gsub sub
+
+These functions merely treat the value as a string
+but issue a lint warning.
+
+ substr match index gensub
+ length split patsplit
tolower toupper
7. Updates to API needed for an additional type, and the table
diff --git a/builtin.c b/builtin.c
index 67a89bd..1158fad 100644
--- a/builtin.c
+++ b/builtin.c
@@ -381,6 +381,8 @@ do_index(int nargs)
s1 = force_string(s1);
s2 = force_string(s2);
+ warn_bool("index", 1, s1);
+ warn_bool("index", 2, s2);
p1 = s1->stptr;
p2 = s2->stptr;
@@ -552,6 +554,7 @@ do_length(int nargs)
if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "length");
tmp = force_string(tmp);
+ warn_bool("length", 1, tmp);
if (gawk_mb_cur_max > 1) {
tmp = force_wstring(tmp);
@@ -1779,6 +1782,16 @@ do_sqrt(int nargs)
return make_number((AWKNUM) sqrt(arg));
}
+/* warn_bool --- warn that bool parameter is used as a string */
+
+void
+warn_bool(const char *func, int argnum, NODE *n)
+{
+ if (do_lint && (n->flags & BOOL) != 0)
+ lintwarn(_("%s: argument %d of type bool used as a string"),
+ func, argnum);
+}
+
/* do_substr --- do the substr function */
NODE *
@@ -1802,6 +1815,7 @@ do_substr(int nargs)
DEREF(t1);
t1 = POP_STRING();
+ warn_bool("substr", 1, t1);
if (nargs == 3) {
if (! (d_length >= 1)) {
@@ -2407,6 +2421,7 @@ do_tolower(int nargs)
NODE *t1, *t2;
t1 = POP_SCALAR();
+ warn_bool("tolower", 1, t1);
if (do_lint && (fixtype(t1)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "tolower");
t1 = force_string(t1);
@@ -2438,6 +2453,7 @@ do_toupper(int nargs)
NODE *t1, *t2;
t1 = POP_SCALAR();
+ warn_bool("toupper", 1, t1);
if (do_lint && (fixtype(t1)->flags & STRING) == 0)
lintwarn(_("%s: received non-string argument"), "toupper");
t1 = force_string(t1);
@@ -2662,6 +2678,7 @@ do_match(int nargs)
tre = POP();
rp = re_update(tre);
t1 = POP_STRING();
+ warn_bool("mastch", 1, t1);
rstart = research(rp, t1->stptr, 0, t1->stlen, RE_NEED_START);
if (rstart >= 0) { /* match succeded */
@@ -2882,6 +2899,7 @@ do_sub(int nargs, unsigned int flags)
rp = re_update(tmp);
target = POP_STRING(); /* original string */
+ warn_bool("gensub", 3, target);
glob_flag = POP_SCALAR(); /* value of global flag */
if ( (glob_flag->flags & STRING) != 0
@@ -2924,6 +2942,10 @@ do_sub(int nargs, unsigned int flags)
}
}
+ if ((target->flags & BOOL) != 0)
+ fatal(_("%s: target cannot be of type bool"),
+ (flags & GSUB) != 0 ? "gsub" : "sub");
+
global = (how_many == -1);
rep_node = POP_STRING(); /* replacement text */
@@ -4324,3 +4346,18 @@ check_symtab_functab(NODE *dest, const char *fname,
const char *msg)
else if (dest == func_table)
fatal(msg, fname, "FUNCTAB");
}
+
+/* do_bool --- create boolean values */
+
+NODE *
+do_bool(int nargs)
+{
+ NODE *tmp;
+ bool result;
+
+ tmp = POP_SCALAR();
+ result = boolval(tmp);
+ DEREF(tmp);
+
+ return make_bool_node(result);
+}
diff --git a/field.c b/field.c
index c21046b..2bd5886 100644
--- a/field.c
+++ b/field.c
@@ -1019,6 +1019,7 @@ do_split(int nargs)
assoc_clear(arr);
src = TOP_STRING();
+ warn_bool("split", 1, src);
if (src->stlen == 0) {
/*
* Skip the work if first arg is the null string.
@@ -1096,6 +1097,7 @@ do_patsplit(int nargs)
_("%s: cannot use %s as second argument"));
src = TOP_STRING();
+ warn_bool("patsplit", 1, src);
if ((sep->flags & REGEX) != 0)
sep = sep->typed_re;
diff --git a/main.c b/main.c
index 9833d84..76f2828 100644
--- a/main.c
+++ b/main.c
@@ -982,23 +982,6 @@ load_procinfo_argv()
assoc_set(PROCINFO_node, sub, argv_array);
}
-/* load_procinfo_bools --- populate PROCINFO["true"] and PROCINFO["false"] */
-
-static void
-load_procinfo_bools()
-{
- NODE *sub;
- NODE *val;
-
- val = make_bool_node(false);
- sub = make_string("false", 5);
- assoc_set(PROCINFO_node, sub, val);
-
- val = make_bool_node(true);
- sub = make_string("true", 4);
- assoc_set(PROCINFO_node, sub, val);
-}
-
/* load_procinfo --- populate the PROCINFO array */
static NODE *
@@ -1085,7 +1068,6 @@ load_procinfo()
}
#endif
load_procinfo_argv();
- load_procinfo_bools();
return PROCINFO_node;
}
diff --git a/test/ChangeLog b/test/ChangeLog
index 53fe562..2604c27 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dumpvars.ok, functab5.ok, id.ok, intest.awk, symtab11.ok,
+ symtab8.ok: Updated after code changes.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): argcasfile, new test.
diff --git a/test/dumpvars.ok b/test/dumpvars.ok
index 85d1c85..7caecd3 100644
--- a/test/dumpvars.ok
+++ b/test/dumpvars.ok
@@ -9,7 +9,7 @@ FILENAME: "-"
FNR: 3
FPAT: "[^[:space:]]+"
FS: " "
-FUNCTAB: array, 41 elements
+FUNCTAB: array, 42 elements
IGNORECASE: 0
LINT: 0
NF: 1
diff --git a/test/functab5.ok b/test/functab5.ok
index 9ac4295..ef11098 100644
--- a/test/functab5.ok
+++ b/test/functab5.ok
@@ -3,6 +3,7 @@ asort'
asorti'
atan2'
bindtextdomain'
+bool'
chdir'
close'
compl'
diff --git a/test/id.ok b/test/id.ok
index ab4df74..f990546 100644
--- a/test/id.ok
+++ b/test/id.ok
@@ -34,6 +34,7 @@ asort -> builtin
asorti -> builtin
atan2 -> builtin
bindtextdomain -> builtin
+bool -> builtin
close -> builtin
compl -> builtin
cos -> builtin
diff --git a/test/intest.awk b/test/intest.awk
index f030d07..18e0cc4 100644
--- a/test/intest.awk
+++ b/test/intest.awk
@@ -1,4 +1,4 @@
BEGIN {
- bool = ((b = 1) in c);
- print bool, b # gawk-3.0.1 prints "0 "; should print "0 1"
+ bool_result = ((b = 1) in c);
+ print bool_result, b # gawk-3.0.1 prints "0 "; should print "0 1"
}
diff --git a/test/symtab11.ok b/test/symtab11.ok
index 7d4be46..da2cfcb 100644
--- a/test/symtab11.ok
+++ b/test/symtab11.ok
@@ -37,6 +37,7 @@ BEGIN -- Functab is next
[asorti] = asorti
[atan2] = atan2
[bindtextdomain] = bindtextdomain
+[bool] = bool
[close] = close
[compl] = compl
[cos] = cos
diff --git a/test/symtab8.ok b/test/symtab8.ok
index da29b58..0cf40fe 100644
--- a/test/symtab8.ok
+++ b/test/symtab8.ok
@@ -9,7 +9,7 @@ FIELDWIDTHS: ""
FNR: 1
FPAT: "[^[:space:]]+"
FS: " "
-FUNCTAB: array, 41 elements
+FUNCTAB: array, 42 elements
IGNORECASE: 0
LINT: 0
NF: 1
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b9931e852ba21180c380639135f96cdcd0a3015f
commit b9931e852ba21180c380639135f96cdcd0a3015f
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Fri Mar 5 14:26:15 2021 +0200
Start on a bool type for gawk.
diff --git a/ChangeLog b/ChangeLog
index 89767c0..52b74a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2021-03-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start on a bool type for gawk.
+
+ * awk.h (BOOL): New flag value.
+ (make_bool_node): Add declaration of new function.
+ (bool_val): Check for BOOL along with NUMBER.
+ * builtin.c (do_typeof): Add support for BOOL.
+ * eval.c (flags2str): Ditto.
+ * gawkapi.h (awk_val_type): Add AWK_BOOL.
+ (awk_value_t): Add awk_bool_t element to the union and macro for it.
+ (struct gawk_api): Update the table of request/return values.
+ * main.c (load_procinfo_bools): New function.
+ (load_procinfo): Call it.
+ * node.c (make_bool_node): New function.
+
2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
* io.c (nextfile): Use the value of ARGC directly in the for
diff --git a/awk.h b/awk.h
index c9eec66..ee055f4 100644
--- a/awk.h
+++ b/awk.h
@@ -463,6 +463,7 @@ typedef struct exp_node {
XARRAY = 0x10000,
NUMCONSTSTR = 0x20000, /* have string value for
numeric constant */
REGEX = 0x40000, /* this is a typed regex */
+ BOOL = 0x80000, /* this is a boolean value */
} flags;
long valref;
} NODE;
@@ -1714,6 +1715,7 @@ extern NODE *r_force_number(NODE *n);
extern NODE *r_format_val(const char *format, int index, NODE *s);
extern NODE *r_dupnode(NODE *n);
extern NODE *make_str_node(const char *s, size_t len, int flags);
+extern NODE *make_bool_node(bool value);
extern NODE *make_typed_regex(const char *re, size_t len);
extern void *more_blocks(int id);
extern int parse_escape(const char **string_ptr);
@@ -1995,7 +1997,7 @@ static inline bool
boolval(NODE *t)
{
(void) fixtype(t);
- if ((t->flags & NUMBER) != 0)
+ if ((t->flags & (BOOL|NUMBER)) != 0)
return ! is_zero(t);
return (t->stlen > 0);
}
diff --git a/bool.notes b/bool.notes
new file mode 100644
index 0000000..51ea726
--- /dev/null
+++ b/bool.notes
@@ -0,0 +1,47 @@
+Fri Mar 5 13:42:44 IST 2021
+============================
+
+Design Notes for a Boolean Type in Gawk
+
+1. At first glance, two new variables named TRUE and FALSE would make sense
+to be predefined values of boolean type. However, since it's likely that
+many awk programs already use them, instead we'll add two new entries
+to PROCINFO: variables PROCINFO["true"] and PROCINFO["false"] of type bool.
+
+Assigning from them copies the bool type, thus they are "factories" of bool
+variables.
+
+2. They have numeric values 1 and 0 respectively, and string values
+"TRUE" and "FALSE". Thus they differ from other variables where a
+"false" value must be zero and null.
+
+This implies all of the following:
+
+ print(PROCINFO["true"]) --> "TRUE"
+ print(PROCINFO["false"]) --> "FALSE"
+ Same for %s in printf
+ Same for bool_var ""
+ printf %d gives 0/1
+
+3. Function bool(val) converts val to bool, returning Boolean TRUE or FALSE.
+
+4. typeof() returns "bool".
+
+5. Numeric operators treat booleans as numbers. asort() sorts booleans before
+numbers, and false before true.
+
+6. These string function generate a runtime fatal error
+if given an argument / target of boolean type:
+
+ substr match index gensub gsub
+ sub length split patsplit
+ tolower toupper
+
+7. Updates to API needed for an additional type, and the table
+for requested vs. returns.
+
+8. The following extensions need revising:
+
+ - JSON extension
+ - dump / read array extensions
+ - what else?
diff --git a/builtin.c b/builtin.c
index 1b612f4..67a89bd 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4112,7 +4112,10 @@ do_typeof(int nargs)
}
break;
case Node_val:
- switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX))
{
+ switch (fixtype(arg)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case BOOL:
+ res = "bool";
+ break;
case NUMBER:
res = "number";
break;
diff --git a/eval.c b/eval.c
index 640f939..75c3932 100644
--- a/eval.c
+++ b/eval.c
@@ -455,6 +455,7 @@ flags2str(int flagval)
{ XARRAY, "XARRAY" },
{ NUMCONSTSTR, "NUMCONSTSTR" },
{ REGEX, "REGEX" },
+ { BOOL, "BOOL" },
{ 0, NULL },
};
diff --git a/gawkapi.h b/gawkapi.h
index 54130b1..3fd02df 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -366,7 +366,8 @@ typedef enum {
AWK_STRNUM,
AWK_ARRAY,
AWK_SCALAR, /* opaque access to a variable */
- AWK_VALUE_COOKIE /* for updating a previously created value */
+ AWK_VALUE_COOKIE, /* for updating a previously created value */
+ AWK_BOOL
} awk_valtype_t;
/*
@@ -381,6 +382,7 @@ typedef struct awk_value {
awk_array_t a;
awk_scalar_t scl;
awk_value_cookie_t vc;
+ awk_bool_t b;
} u;
#define str_value u.s
#define strnum_value str_value
@@ -391,6 +393,7 @@ typedef struct awk_value {
#define array_cookie u.a
#define scalar_cookie u.scl
#define value_cookie u.vc
+#define bool_value u.b
} awk_value_t;
/*
@@ -567,26 +570,28 @@ typedef struct gawk_api {
+-------------------------------------------------------+
| Type of Actual Value:
|
-
+--------+--------+--------+--------+-------+-----------+
- | String | Strnum | Number | Regex | Array |
Undefined |
-
+-----------+-----------+--------+--------+--------+--------+-------+-----------+
- | | String | String | String | String | String | false |
false |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Strnum | false | Strnum | Strnum | false | false |
false |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Number | Number | Number | Number | false | false |
false |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Regex | false | false | false | Regex | false |
false |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | Type | Array | false | false | false | false | Array |
false |
- | Requested
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Scalar | Scalar | Scalar | Scalar | Scalar | false |
false |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Undefined | String | Strnum | Number | Regex | Array |
Undefined |
- |
+-----------+--------+--------+--------+--------+-------+-----------+
- | | Value | false | false | false | false | false |
false |
- | | Cookie | | | | | |
|
-
+-----------+-----------+--------+--------+--------+--------+-------+-----------+
+
+--------+--------+--------+--------+--------+-------+-----------+
+ | String | Strnum | Number | Regex | Bool |
Array | Undefined |
+
+-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | String | String | String | String | String | String |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Strnum | false | Strnum | Strnum | false | false |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Number | Number | Number | Number | false | Number |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Regex | false | false | false | Regex | false |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Bool | false | false | false | false | Bool |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | Type | Array | false | false | false | false | false |
Array | false |
+ | Requested
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Scalar | Scalar | Scalar | Scalar | Scalar | Scalar |
false | false |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Undefined | String | Strnum | Number | Regex | Bool |
Array | Undefined |
+ |
+-----------+--------+--------+--------+--------+--------+-------+-----------+
+ | | Value | false | false | false | false | false |
false | false |
+ | | Cookie | | | | | |
| |
+
+-----------+-----------+--------+--------+--------+--------+--------+-------+-----------+
*/
/* Functions to handle parameters passed to the extension. */
diff --git a/main.c b/main.c
index 5b153bc..9833d84 100644
--- a/main.c
+++ b/main.c
@@ -980,7 +980,23 @@ load_procinfo_argv()
// hook it into PROCINFO
sub = make_string("argv", 4);
assoc_set(PROCINFO_node, sub, argv_array);
+}
+
+/* load_procinfo_bools --- populate PROCINFO["true"] and PROCINFO["false"] */
+
+static void
+load_procinfo_bools()
+{
+ NODE *sub;
+ NODE *val;
+
+ val = make_bool_node(false);
+ sub = make_string("false", 5);
+ assoc_set(PROCINFO_node, sub, val);
+ val = make_bool_node(true);
+ sub = make_string("true", 4);
+ assoc_set(PROCINFO_node, sub, val);
}
/* load_procinfo --- populate the PROCINFO array */
@@ -1069,6 +1085,7 @@ load_procinfo()
}
#endif
load_procinfo_argv();
+ load_procinfo_bools();
return PROCINFO_node;
}
diff --git a/node.c b/node.c
index c22c06a..dda90f0 100644
--- a/node.c
+++ b/node.c
@@ -1082,3 +1082,25 @@ more_blocks(int id)
}
#endif
+
+/* make_bool_node --- make a boolean-valued node */
+
+extern NODE *
+make_bool_node(bool value)
+{
+ NODE *val;
+ const char *sval;
+ AWKNUM nval;
+
+ sval = (value ? "TRUE" : "FALSE");
+ nval = (value ? 1.0 : 0.0);
+
+ val = make_number(nval);
+ val->stptr = estrdup(sval, strlen(sval));
+ val->stlen = strlen(sval);
+ val->flags &= ~NUMBER;
+ val->flags |= NUMCUR|STRCUR|BOOL;
+ val->stfmt = STFMT_UNUSED;
+
+ return val;
+}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 86 ++++
NEWS | 6 +
array.c | 3 +-
awk.h | 33 +-
awkgram.c | 1 +
awkgram.y | 1 +
builtin.c | 20 +-
doc/ChangeLog | 34 ++
doc/awkcard.in | 31 +-
doc/gawk.1 | 16 +-
doc/gawk.info | 1344 +++++++++++++++++++++++++++------------------------
doc/gawk.texi | 176 +++++--
doc/gawktexi.in | 176 +++++--
eval.c | 1 +
extension/ChangeLog | 9 +
extension/rwarray.c | 40 +-
extension/testext.c | 7 +
gawkapi.c | 44 +-
gawkapi.h | 63 ++-
main.c | 1 -
node.c | 21 +
pc/ChangeLog | 4 +
pc/Makefile.tst | 7 +-
test/ChangeLog | 21 +
test/Makefile.am | 4 +-
test/Makefile.in | 9 +-
test/Maketests | 5 +
test/asortbool.awk | 19 +
test/asortbool.ok | 6 +
test/dumpvars.ok | 2 +-
test/functab5.ok | 1 +
test/id.ok | 1 +
test/intest.awk | 4 +-
test/rwarray.awk | 11 +
test/symtab11.ok | 1 +
test/symtab8.ok | 2 +-
36 files changed, 1428 insertions(+), 782 deletions(-)
create mode 100644 test/asortbool.awk
create mode 100644 test/asortbool.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-4376-ge9653d5,
Arnold Robbins <=