I just realised I expressed an opinion about associative arrays while the
original post was about indexed arrays.

My take on this is that indexed arrays are almost always "dynamic"; while
it's possible to use constant indices to emulate a struct, that is unusual.
For most purposes the flexibility in adding & removing from an array is a
feature, not a bug.

The support for missing elements or 'empty slots' is a bit unusual, but
once that's given, it's entirely predictable that "missing" elements are
just a normal kind of data, which is where I was heading with my suggestion
about non-sparse arrays.

On Mon, 22 May 2023 at 07:01, Martin D Kealey <mar...@kurahaupo.gen.nz>
wrote:
[...]

> 2. ${#array[@]} gives the number of elements rather than the last index
> (minus 1). Being able to declare an array as non-sparse (so that all gaps
> "exist" with some default value) would fix this.
>

-Martin

Reply via email to