diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-01 20:54:20 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-01 20:54:20 +0200 |
commit | 545cc9691e3d6479053684815d23e6553a7d0a95 (patch) | |
tree | ed2d4bb149410bcb382aa05545a5e3d56289c927 /doc/gawktexi.in | |
parent | 86cd3e2cb5117c5800997d3bb363b6d5470be3ce (diff) | |
parent | bcb51623b8e156b03c2ae588906e4ed25fa3eba2 (diff) | |
download | egawk-545cc9691e3d6479053684815d23e6553a7d0a95.tar.gz egawk-545cc9691e3d6479053684815d23e6553a7d0a95.tar.bz2 egawk-545cc9691e3d6479053684815d23e6553a7d0a95.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r-- | doc/gawktexi.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in index f3805887..64a4ef28 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -18496,8 +18496,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 @@ -19215,13 +19219,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 |