bug-gawk
[Top][All Lists]
Advanced

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

Re: gawk-5.2.2: fatal: attempt to use scalar parameter `a' as an array


From: Rajeev V. Pillai
Subject: Re: gawk-5.2.2: fatal: attempt to use scalar parameter `a' as an array
Date: Mon, 5 Jun 2023 11:59:04 +0000 (UTC)

 On Sunday, 4 June 2023 at 13:44:50 UTC, arnold@skeeve.com <arnold@skeeve.com> 
wrote: 

> When length() is called on an untyped variable, said untyped variable is
> coerced into being a scalar, since that is historical practice in awk.
> Then:
>
>    a[++n] = s
>
> tries to treat 'a' as an array, and gawk generates the fatal message.
> [...]
> I hope this explanation clarifies the behavior for you.

Thanks for the explanation; I had come to much the same conclusion myself, but,
onetrueawk coerces `A' into an array type--according to the `-d' output. Does 
this
mean it isn't POSIX-compliant in this regard?

-RVP


reply via email to

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