aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-10-01 10:20:30 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-10-01 10:20:30 +0300
commit76a79c4e3b15afa86b468c203479af276647fd7d (patch)
tree68d09bf0888a4d8361a46527369bfc0e10f6f806 /doc/gawk.texi
parent5275b934abb8392961e22a78c7dc5e9f70eb6db0 (diff)
parent00d8cf5ca447dc385a869621e97d67b3f3bca80a (diff)
downloadegawk-76a79c4e3b15afa86b468c203479af276647fd7d.tar.gz
egawk-76a79c4e3b15afa86b468c203479af276647fd7d.tar.bz2
egawk-76a79c4e3b15afa86b468c203479af276647fd7d.zip
Merge branch 'master' into feature/docit
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index ec7afb8d..349abd15 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -21052,6 +21052,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