bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] array initialization


From: Andrew J. Schorr
Subject: Re: [bug-gawk] array initialization
Date: Fri, 4 Jan 2019 17:35:48 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jan 04, 2019 at 05:28:02PM -0500, Andrew J. Schorr wrote:
> Based on some debugging, I believe one can actually get a "null" (typeless) 
> array
> like so:
>    split("", y)

Well, oops, this approach doesn't seem to work for subarrays:

bash-4.2$ ./gawk 'BEGIN {split("", y[1]); print isarray(y)}'
gawk: cmd. line:1: fatal: split: second argument is not an array

So using "split" does not seem to work in the general case.

Is there a way to do this properly? This two-step process seems to work:
   y[1][1] = 0
   split("", y[1])
But that's rather cumbersome...

Regards,
Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]