[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk feature request: array assignment
From: |
Aharon Robbins |
Subject: |
Re: gawk feature request: array assignment |
Date: |
Sat, 11 Apr 2009 22:05:09 +0300 |
Hi.
Thank you for your mail.
While I agree that it would be nice if arrays were true first class
elements of the language, this is not likely to happen, for two
reasons.
1. It would be a very significant departure from historical practice
and the awk language as standardized by POSIX.
2. The current gawk code base is not really up to supporting this.
Thanks,
Arnold
> Date: Thu, 9 Apr 2009 11:46:29 -0700 (PDT)
> From: Charles Obler <address@hidden>
> Subject: gawk feature request: array assignment
> To: address@hidden
>
> Hello awk people --
>
> It would be very nice to be able to assign and return arrays. Currently,
> when I attempt this, I get a fatal "attempt to use array in a scalar
> context" error message.
>
> I'm attempting to make my awk program somewhat "object-oriented",
> with associative arrays taking the place of "objects" or "classes".
> Unfortunately, when I try to return or store one of these "objects",
> awk complains.
>
> E.g.:
>
> vNaEl = ObjName( vName, vType, vStat) # create a name object
> vNASu++ # incr array subscripb
> vNArr[ vNASu] = vNaEl # save the object in the objects array
>
> The third statement kills awk.