bug-gawk
[Top][All Lists]
Advanced

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

Re: typeof() creates elements in an array


From: Andrew J. Schorr
Subject: Re: typeof() creates elements in an array
Date: Thu, 30 Sep 2021 08:54:25 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 30, 2021 at 06:48:06AM -0600, arnold@skeeve.com wrote:
> Hi.
> 
> "Andrew J. Schorr" <aschorr@telemetry-investments.com> wrote:
> 
> > Thanks for looking, but I suspected that it would be really difficult
> > in view of current internals. As a general language feature, it might be
> > nice to avoid locking down an array element type the moment it is first
> > referenced, but my sense is that it would be a big job to achieve this,
> > if it's possible at all.
> 
> You're right, it'd be a lot of work, and I don't think the ROI is
> worth it.  It's better to just make multidimensional arrays as
> such up front.

I've certainly had situations where I had to jump through hoops to make it
clear that a given array element was being used as a sub-array by setting a
dummy sub-element and then removing it. The "natural" usage pattern didn't
work, and would yield a fatal attempt to use scalar as an array error. So it
would be nice if that were not necessary, but I agree that it's probably a lot
of work.

Regards,
Andy



reply via email to

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