diff options
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 452 |
1 files changed, 392 insertions, 60 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index c3ec64e5..84612764 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()}. @@ -863,6 +865,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{number|bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Controlling Array Traversal:: How to use PROCINFO["sorted_in"]. @@ -926,6 +929,7 @@ particular records in a file and perform operations upon them. * Inexact representation:: Numbers are not exactly represented. * Comparing FP Values:: How to compare floating point values. * Errors accumulate:: Errors get bigger as they go. +* Strange values:: A few words about infinities and NaNs. * Getting Accuracy:: Getting more accuracy takes some work. * Try To Round:: Add digits and round. * Setting precision:: How to set the precision. @@ -3144,11 +3148,12 @@ column means that the person is a friend. An @samp{R} means that the person is a relative: @example -@c system if test ! -d eg ; then mkdir eg ; fi -@c system if test ! -d eg/lib ; then mkdir eg/lib ; fi -@c system if test ! -d eg/data ; then mkdir eg/data ; fi -@c system if test ! -d eg/prog ; then mkdir eg/prog ; fi -@c system if test ! -d eg/misc ; then mkdir eg/misc ; fi +@c system if test ! -d eg ; then mkdir eg ; fi +@c system if test ! -d eg/lib ; then mkdir eg/lib ; fi +@c system if test ! -d eg/data ; then mkdir eg/data ; fi +@c system if test ! -d eg/prog ; then mkdir eg/prog ; fi +@c system if test ! -d eg/misc ; then mkdir eg/misc ; fi +@c system if test ! -d eg/test-programs ; then mkdir eg/test-programs ; fi @c file eg/data/mail-list Amelia 555-5553 amelia.zodiacusque@@gmail.com F Anthony 555-3412 anthony.asserturo@@hotmail.com A @@ -4848,7 +4853,10 @@ blocksize, which is usually the filesystem's I/O blocksize.) If this variable exists with a value of @samp{gst}, @command{gawk} switches to using the hash function from GNU Smalltalk for managing arrays. -This function may be marginally faster than the standard function. +With a value of @samp{fnv1a}, @command{gawk} uses the +@uref{http://www.isthe.com/chongo/tech/comp/fnv/index.html, +FNV1-A hash function}. +These functions may be marginally faster than the standard function. @item AWKREADFUNC If this variable exists, @command{gawk} switches to reading source @@ -10203,7 +10211,7 @@ infinity are formatted as and positive infinity as @samp{inf} or @samp{infinity}. The special ``not a number'' value formats as @samp{-nan} or @samp{nan} -(@pxref{Math Definitions}). +(@pxref{Strange values}). @item @code{%F} Like @samp{%f}, but the infinity and ``not a number'' values are spelled @@ -18306,6 +18314,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 @@ -18375,6 +18384,25 @@ 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 function is specific to @command{gawk}. It is not +available in compatibility mode (@pxref{Options}): + +@c @asis for docbook +@table @asis +@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. +Boolean ``false'' values have numeric +zero. This is discussed in more +detail in @ref{Boolean Typed Values}. +@end table + @node Numeric Functions @subsection Numeric Functions @cindex numeric @subentry functions @@ -18439,7 +18467,7 @@ compatibility mode (@pxref{Options}). @cindexawkfunc{log} @cindex logarithm Return the natural logarithm of @var{x}, if @var{x} is positive; -otherwise, return @code{NaN} (``not a number'') on IEEE 754 systems. +otherwise, return NaN (``not a number'') on IEEE 754 systems. Additionally, @command{gawk} prints a warning message when @code{x} is negative. @@ -20900,6 +20928,9 @@ Return one of the following strings, depending upon the type of @var{x}: @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. @@ -21778,7 +21809,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 @@ -29429,6 +29460,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{number|bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Two-way I/O:: Two-way communications with another process. @@ -29495,6 +29527,49 @@ 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 + +Scalar values in @command{awk} are either numbers or strings. +@command{gawk} also supports values of type @code{regexp} +(@pxref{Strong Regexp Constants}). + +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. +(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; +there's no way to indicate that a value is really Boolean. + +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. + +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{mkbool()}. + +The @code{typeof()} function (@pxref{Type Functions}) returns +@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 +undoubtedly have broken many existing @command{awk} programs. Instead, +having a ``generator'' function that creates Boolean values gives +flexibility, without breaking as much existing code. + @node Array Sorting @section Controlling Array Traversal and Array Sorting @@ -33849,21 +33924,9 @@ A special value representing infinity. Operations involving another number and infinity produce infinity. @item NaN -``Not a number.''@footnote{Thanks to Michael Brennan for this description, -which we have paraphrased, and for the examples.} A special value that -results from attempting a calculation that has no answer as a real number. -In such a case, programs can either receive a floating-point exception, -or get @code{NaN} back as the result. The IEEE 754 standard recommends -that systems return @code{NaN}. Some examples: - -@table @code -@item sqrt(-1) -This makes sense in the range of complex numbers, but not in the -range of real numbers, so the result is @code{NaN}. - -@item log(-8) -@minus{}8 is out of the domain of @code{log()}, so the result is @code{NaN}. -@end table +``Not a number.'' A special value that results from attempting a +calculation that has no answer as a real number. @xref{Strange values}, +for more information about infinity and not-a-number values. @item Normalized How the significand (see later in this list) is usually stored. The @@ -34032,6 +34095,7 @@ decimal places in the final result. * Inexact representation:: Numbers are not exactly represented. * Comparing FP Values:: How to compare floating point values. * Errors accumulate:: Errors get bigger as they go. +* Strange values:: A few words about infinities and NaNs. @end menu @node Inexact representation @@ -34153,6 +34217,242 @@ $ @kbd{gawk 'BEGIN @{} @print{} 4 @end example +@node Strange values +@subsubsection Floating Point Values They Didn't Talk About In School + +Both IEEE 754 floating-point hardware, and MPFR, support two kinds of +values that you probably didn't learn about in school. The first is +@dfn{infinity}, a special value, that can be either negative or positive, +and which is either smaller than any other value (negative infinity), +or larger than any other value (positive infinity). When such values +are generated, @command{gawk} prints them as either @samp{-inf} or +@samp{+inf}, respectively. It accepts those strings as data input and +converts them to the proper floating-point values internally. + +Infinity values of the same sign compare as equal to each other. +Otherwise, operations (addition, subtraction, etc.) involving another +number and infinity produce mathematically reasonable results. + +The second kind of value is ``not a number'', or NaN for +short.@footnote{Thanks to Michael Brennan for this description, which we +have paraphrased, and for the examples.} This is a special value that results +from attempting a calculation that has no answer as a real number. +In such a case, programs can either receive a floating-point exception, +or get NaN back as the result. The IEEE 754 standard recommends +that systems return NaN. Some examples: + +@table @code +@item sqrt(-1) +@iftex +The @math{\sqrt{-1}} +@end iftex +@ifnottex +This +@end ifnottex +makes sense in the range of complex numbers, but not in the +range of real numbers, so the result is NaN. + +@item log(-8) +@minus{}8 is out of the domain of @code{log()}, so the result is NaN. +@end table + +NaN values are strange. In particular, they cannot be compared with other +floating point values; any such comparison, except for ``is not equal +to'', returns false. NaN values are so much unequal to other values that +even comparing two identical NaN values with @code{!=} returns true! + +NaN values can also be signed, although it depends upon the implementation +as to which sign you get for any operation that returns a NaN. For +example, on some systems, @code{sqrt(-1)} returns a negative NaN. On +others, it returns a positive NaN. + +When such values are generated, @command{gawk} prints them as either +@samp{-nan} or @samp{+nan}, respectively. Here too, @command{gawk} +accepts those strings as data input and converts them to the proper +floating-point values internally. + +If you want to dive more deeply into this topic, you can find +test programs in C, @command{awk} and Python in the directory +@file{awklib/eg/test-programs} in the @command{gawk} distribution. +These programs enable comparison among programming languages as to how +they handle NaN and infinity values. + +@ignore +@c file eg/test-programs/gen-float-table.awk +function eq(left, right) +@{ + return left == right +@} + +function ne(left, right) +@{ + return left != right +@} + +function lt(left, right) +@{ + return left < right +@} + +function le(left, right) +@{ + return left <= right +@} + +function gt(left, right) +@{ + return left > right +@} + +function ge(left, right) +@{ + return left >= right +@} + +BEGIN @{ + nan = sqrt(-1) + inf = -log(0) + split("== != < <= > >=", names) + names[3] = names[3] " " + names[5] = names[5] " " + split("eq ne lt le gt ge", funcs) + + compare[1] = 2.0 + compare[2] = values[1] = -sqrt(-1.0) # nan + compare[3] = values[2] = sqrt(-1.0) # -nan + compare[4] = values[3] = -log(0.0) # inf + compare[5] = values[4] = log(0.0) # -inf + + for (i = 1; i in values; i++) @{ + for (j = 1; j in compare; j++) @{ + for (k = 1; k in names; k++) @{ + the_func = funcs[k] + printf("%g %s %g -> %s\n", + values[i], + names[k], + compare[j], + @@the_func(values[i], compare[j]) ? + "True" : "False"); + @} + printf("\n"); + @} + @} +@} +@c endfile +@end ignore + +@ignore +@c file eg/test-programs/gen-float-table.c +#include <stdio.h> +#include <math.h> +#include <stdbool.h> + +#define def_func(name, op) \ + bool name(double left, double right) @{ \ + return left op right; \ + @} + +def_func(eq, ==) +def_func(ne, !=) +def_func(lt, <) +def_func(le, <=) +def_func(gt, >) +def_func(ge, >=) + +struct @{ + const char *name; + bool (*func)(double left, double right); +@} functions[] = @{ + @{ "==", eq @}, + @{ "!=", ne @}, + @{ "< ", lt @}, + @{ "<=", le @}, + @{ "> ", gt @}, + @{ ">=", ge @}, + @{ 0, 0 @} +@}; + +int main() +@{ + double values[] = @{ + -sqrt(-1), // nan + sqrt(-1), // -nan + -log(0.0), // inf + log(0.0) // -inf + @}; + double compare[] = @{ 2.0, + -sqrt(-1), // nan + sqrt(-1), // -nan + -log(0.0), // inf + log(0.0) // -inf + @}; + + int i, j, k; + + for (i = 0; i < 4; i++) @{ + for (j = 0; j < 5; j++) @{ + for (k = 0; functions[k].name != NULL; k++) @{ + printf("%g %s %g -> %s\n", values[i], + functions[k].name, + compare[j], + functions[k].func(values[i], compare[j]) ? "True" : "False"); + @} + printf("\n"); + @} + @} + + return 0; +@} +@c endfile +@end ignore + +@ignore +@c file eg/test-programs/gen-float-table.py +from math import * + +nan = float('NaN') +inf = float('Inf') + +def eq(left, right): + return left == right + +def ne(left, right): + return left != right + +def lt(left, right): + return left < right + +def le(left, right): + return left <= right + +def gt(left, right): + return left > right + +def ge(left, right): + return left >= right + +func_map = { + "==": eq, + "!=": ne, + "< ": lt, + "<=": le, + "> ": gt, + ">=": ge, +} + +compare = [2.0, nan, -nan, inf, -inf] +values = [nan, -nan, inf, -inf] + +for i in range(len(values)): + for j in range(len(compare)): + for op in func_map: + print("%g %s %g -> %s" % + (values[i], op, compare[j], func_map[op](values[i], compare[j]))) + + print("") +@c endfile +@end ignore + @node Getting Accuracy @subsection Getting the Accuracy You Need @@ -35424,7 +35724,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}. @@ -35437,6 +35738,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.'' @@ -35452,6 +35754,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. @@ -35779,6 +36082,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 @@ -36579,7 +36887,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> @@ -36589,6 +36898,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> @@ -36601,6 +36911,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> @@ -36613,6 +36924,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> @@ -36621,6 +36933,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> @@ -36629,6 +36942,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> @@ -36636,11 +36950,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> @@ -36651,6 +36977,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> @@ -36661,6 +36988,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> @@ -36673,6 +37001,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> @@ -36689,43 +37018,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 @@ -45296,8 +45628,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 |