bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] fatal: cannot assign to arbitrary elements of SYMTAB


From: Andrew J. Schorr
Subject: Re: [bug-gawk] fatal: cannot assign to arbitrary elements of SYMTAB
Date: Wed, 17 Apr 2019 09:09:12 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Tue, Apr 16, 2019 at 04:05:25PM -0500, Peng Yu wrote:
> The following command used to work. But it stops working in "GNU Awk
> 5.0.0, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2)".
> 
> $ awk -e 'BEGIN { SYMTAB["foo"] = "1"; print SYMTAB["foo"] }'
> awk: cmd. line:1: fatal: cannot assign to arbitrary elements of SYMTAB

Why is this program better than:

bash-4.2$ ./gawk -e 'BEGIN { SYMTAB["foo"] = "1"; print foo }'
1

> Is there anything that can be done to get the original behavior? Thanks.

Why? How is it better than my revised version above which continues
to work fine? What's the usage case for assigning to arbitrary variable
names that are never used in the program?

Regards,
Andy



reply via email to

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