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: Peng Yu
Subject: Re: [bug-gawk] fatal: cannot assign to arbitrary elements of SYMTAB
Date: Thu, 18 Apr 2019 08:36:07 -0500

Did you introduce the change and could revert it back? Otherwise, I don’t
want to waste my time on this as I already showed the main points. In the
nut shell, the changes should be have been backward compatible. If you were
not sure whether a feature was good or not, you need to mark it as
experimental. If a bad feature was not marked as experimental, at least you
should give some warnings to let the features still work for a few years
before eventually removing it. These are basic software engineering
practices. It is disappointing that it was not followed.

On Thu, Apr 18, 2019 at 7:38 AM Andrew J. Schorr <
address@hidden> wrote:

> Hi,
>
> On Wed, Apr 17, 2019 at 10:12:18PM -0500, Peng Yu wrote:
> > You assume that the header must be a valid awk variable name. That is
> > a too stringent condition. Not all headers satisfy this condition.
> >
> > Also, people might want to specify the column name in the command line
> > via `-v`. It is not possible to do so using your command.
> >
> > > 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?
>
> Can you please share an example of what you're trying to do? I really don't
> understand your paradigm. When I process a file that contains column
> headers, I
> do something like this:
>
> gawk '-F|' '
> NR == 1 {
>    for (i = 1; i <= NF; i++)
>       m[$i] = i
>    next
> }
>
> {
>    printf "%s lives at %s\n", $m["name"], $m["address"]
> }'
>
> Is this the type of situation you're talking about?
>
> Regards,
> Andy
>
-- 
Regards,
Peng


reply via email to

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