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.
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 <joyins...@yahoo.com>
> Subject: gawk feature request: array assignment
> To: bug-...@gnu.org