From 0cb66f4f80cc8c2df63aed30e2cf5753a106b951 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 2 Jan 2017 09:38:13 -0500 Subject: Improve documentation of API strnum feature. --- doc/gawk.texi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index 25468301..e78134cb 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -32618,6 +32618,14 @@ When an extension creates a strnum value, the result is a string flagged as user input. Subsequent parsing by @command{gawk} then determines whether it looks like a number and should be treated as a strnum, or as a regular string. +This is useful in cases where an extension function would like to do something +comparable to the @code{split()} function which sets the user input attribute +on the array elements it creates. For example, an extension that implements +CSV splitting would want to use this feature. This is also useful for a +function that retrieves a data item from a database. The PostgreSQL +@code{PQgetvalue()} function, for example, returns a string that may be numeric +or textual depending on the contents. + Typed regexp values (@pxref{Strong Regexp Constants}) are not of much use to extension functions. Extension functions can tell that they've received them, and create them for scalar values. Otherwise, -- cgit v1.2.3