diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-02-01 14:32:51 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-02-01 14:32:51 -0500 |
commit | 2473b938036dfdd32ff47833ea032a80a6fa5659 (patch) | |
tree | f5a61f6446c8ed4a3c30e51c0cf2c26b48d39cb8 /doc/gawk.texi | |
parent | a3eb4b0a735b4fbd60ed66154befd31c56b601db (diff) | |
parent | 545cc9691e3d6479053684815d23e6553a7d0a95 (diff) | |
download | egawk-2473b938036dfdd32ff47833ea032a80a6fa5659.tar.gz egawk-2473b938036dfdd32ff47833ea032a80a6fa5659.tar.bz2 egawk-2473b938036dfdd32ff47833ea032a80a6fa5659.zip |
Merge branch 'master' into select
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index 9ad9e3d4..cc215c6a 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19427,8 +19427,12 @@ According to the POSIX standard, function parameters cannot have the same name as one of the special predefined variables (@pxref{Built-in Variables}), nor may a function parameter have the same name as another function. + Not all versions of @command{awk} enforce these restrictions. +@command{gawk} always enforces the first restriction. +With @option{--posix} (@pxref{Options}), +it also enforces the second restriction. @end quotation Local variables act like the empty string if referenced where a string @@ -20146,13 +20150,13 @@ using indirect function calls: @c file eg/prog/indirectcall.awk # average --- return the average of the values in fields $first - $last -function average(first, last, the_sum, i) +function average(first, last, sum, i) @{ - the_sum = 0; + sum = 0; for (i = first; i <= last; i++) - the_sum += $i + sum += $i - return the_sum / (last - first + 1) + return sum / (last - first + 1) @} # sum --- return the sum of the values in fields $first - $last |