diff options
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r-- | doc/gawktexi.in | 73 |
1 files changed, 58 insertions, 15 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 2cda4028..84618fd6 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -4907,6 +4907,15 @@ NaN and Infinity values, instead of the special values @command{gawk} usually produces, as described in @ref{POSIX Floating Point Problems}. This is mainly useful for the included unit tests. +The @code{typeof()} built-in function +(@pxref{Type Functions}) +takes an optional second array argument that, if present, will be cleared +and populated with some information about the internal implementation of +the variable. This can be useful for debugging. At the moment, this +returns a textual version of the flags for scalar variables, and the +array back-end implementation type for arrays. This interface is subject +to change and may not be stable. + @end ignore @node Invoking Summary @@ -15074,6 +15083,30 @@ The values indicate what @command{gawk} knows about the identifiers after it has finished parsing the program; they are @emph{not} updated while the program runs. +@item PROCINFO["platform"] +@cindex platform running on, @code{PROCINFO["platform"]} +This element gives a string indicating the platform for which +@command{gawk} was compiled. The value will be one of the following: + +@c nested table +@table @code +@item "vms" +OpenVMS or Vax/VMS. + +@item "djgpp" +@itemx "mingw" +Microsoft Windows, using either DJGPP or MinGW, respectively. + +@item "os2" +OS/2. + +@item "os390" +OS/390. + +@item "posix" +GNU/Linux, Cygwin, Mac OS X, and legacy Unix systems. +@end table + @item PROCINFO["pgrpid"] @cindex process group ID of @command{gawk} process The process group ID of the current process. @@ -15234,7 +15267,8 @@ if an element in @code{SYMTAB} is an array. Also, you may not use the @code{delete} statement with the @code{SYMTAB} array. -You may use an index for @code{SYMTAB} that is not a predefined identifier: +Prior to @value{PVERSION} 5.0 of @command{gawk}, you could +use an index for @code{SYMTAB} that was not a predefined identifier: @example SYMTAB["xxx"] = 5 @@ -15242,9 +15276,8 @@ print SYMTAB["xxx"] @end example @noindent -This works as expected: in this case @code{SYMTAB} acts just like -a regular array. The only difference is that you can't then delete -@code{SYMTAB["xxx"]}. +This no longer works, instead producing a fatal error, as it led +to rampant confusion. @cindex Schorr, Andrew The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr @@ -28116,6 +28149,7 @@ of the program and the precedence rules. For example, @samp{(3 + 5) * 4} means add three and five, then multiply the total by four. However, @samp{3 + 5 * 4} has no parentheses, and means @samp{3 + (5 * 4)}. +However, explicit parentheses in the source program are retained. @ignore @item @@ -28154,12 +28188,14 @@ come out as: @example /foo/ @{ - print $0 + print @} @end example @noindent which is correct, but possibly unexpected. +(If a program uses both @samp{print $0} and plain +@samp{print}, that distinction is retained.) @cindex profiling @command{awk} programs, dynamically @cindex @command{gawk} program, dynamic profiling @@ -28247,12 +28283,10 @@ There is a significant difference between the output created when profiling, and that created when pretty-printing. Pretty-printed output preserves the original comments that were in the program, although their placement may not correspond exactly to their original locations in the -source code.@footnote{@command{gawk} does the best it can to preserve +source code. However, no comments should be lost. +Also, @command{gawk} does the best it can to preserve the distinction between comments at the end of a statement and comments -on lines by themselves. Due to implementation constraints, it does not -always do so correctly, particularly for @code{switch} statements. The -@command{gawk} maintainers hope to improve this in a subsequent -release.} +on lines by themselves. This isn't always perfect, though. However, as a deliberate design decision, profiling output @emph{omits} the original program's comments. This allows you to focus on the @@ -37902,6 +37936,14 @@ Support for GNU/Linux on Alpha was removed. @end itemize +Version 5.0 added the following features: + +@itemize +@item +The @code{PROCINFO["platform"]} array element, which allows you +to write code that takes the operating system / platform into account. +@end itemize + @c XXX ADD MORE STUFF HERE @end ifclear @@ -38864,11 +38906,6 @@ include the major and minor API versions in it. This makes it possible to keep extensions for different API versions on the same system without their conflicting with one another. -@cindex @option{--with-whiny-user-strftime} configuration option -@cindex configuration option, @code{--with-whiny-user-strftime} -@item --with-whiny-user-strftime -Force use of the included version of the C @code{strftime()} -function for deficient systems. @end table Use the command @samp{./configure --help} to see the full list of @@ -39054,6 +39091,12 @@ appropriate @samp{-v BINMODE=@var{N}} option on the command line. @code{BINMODE} is set at the time a file or pipe is opened and cannot be changed midstream. +On POSIX-compatible systems, this variable's value has no effect. +Thus, if you think your program will run on multiple different systems +and that you may need to use @code{BINMODE}, you should simply set it +(in the program or on the command line) unconditionally, and not worry +about the operating system on which your program is running. + The name @code{BINMODE} was chosen to match @command{mawk} (@pxref{Other Versions}). @command{mawk} and @command{gawk} handle @code{BINMODE} similarly; however, |