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: Fri, 1 Oct 2021 16:00:53 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Oct 01, 2021 at 06:53:56PM +0000, Tom Gray wrote:
> Also changing the behavior could break existing code.

I'm not convined that any existing code would break. I think the change
merely creates new possibilities.

> What would be a more helpful enhancement is a more succinct way to declare 
> and array without assigning any elements.

I find it a bit clunky to have to declare arrays before using them.
The beauty of AWK is that things just work intuitively as one wants, in
most cases. But for subarrays, that is not always true.

> This might be better:
> 
>    x[0][]
> 
> But it's a syntax error. If it were not a syntax error, what would it return? 
> .... a pointer to an array? Now we'd have something useful.

That could be cool, but it may be orthogonal to this issue.

Regards,
Andy



reply via email to

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