diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-10-01 10:20:30 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-10-01 10:20:30 +0300 |
commit | 76a79c4e3b15afa86b468c203479af276647fd7d (patch) | |
tree | 68d09bf0888a4d8361a46527369bfc0e10f6f806 /doc/gawktexi.in | |
parent | 5275b934abb8392961e22a78c7dc5e9f70eb6db0 (diff) | |
parent | 00d8cf5ca447dc385a869621e97d67b3f3bca80a (diff) | |
download | egawk-76a79c4e3b15afa86b468c203479af276647fd7d.tar.gz egawk-76a79c4e3b15afa86b468c203479af276647fd7d.tar.bz2 egawk-76a79c4e3b15afa86b468c203479af276647fd7d.zip |
Merge branch 'master' into feature/docit
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r-- | doc/gawktexi.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 110e090c..abe5a236 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -19964,6 +19964,29 @@ function causes it to become a scalar variable (unassigned). However, @code{isarray()} and @code{typeof()} are different; they do not change their arguments from untyped to unassigned. +@cindex dark corner @subentry array elements created by reference +By ``variable'' we mean one denoted by a simple identifier. Array elements +that come into existence simply by referencing them +are different, they are automatically forced to be scalars. Consider: + +@example +$ @kbd{gawk 'BEGIN @{ print typeof(x) @}'} +@print{} untyped +$ @kbd{gawk 'BEGIN @{ print typeof(x["foo"]) @}'} +@print{} unassigned +@end example + +@noindent +@code{x[0]} comes into existence before it is passed to @code{typeof()}; +@code{typeof()} cannot tell that it didn't exist prior to being called. +@value{DARKCORNER} + +@c FIXME: For 5.2, this will change, update this bit of doc. +This may change in a future release, whereby @command{gawk} +would allow such an unassigned array element to be used for +a multidimensional array, and not remain a scalar forever +(or until deleted). + @node I18N Functions @subsection String-Translation Functions @cindex @command{gawk} @subentry string-translation functions |