bug-bash
[Top][All Lists]
Advanced

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

Re: Changing the way bash expands associative array subscripts


From: konsolebox
Subject: Re: Changing the way bash expands associative array subscripts
Date: Wed, 7 Apr 2021 03:53:43 +0800

On Wed, Apr 7, 2021 at 12:20 AM Ilkka Virta <itvirta@gmail.com> wrote:
> What konsolebox said about a[$k]=() works in my Zsh for indexed arrays, but
> not associative ones.
> (It replaces an array slice, so can also be used to insert elements in the
> middle.)

Bash can adopt this. Also if Bash could just store associative array
values as a list to preserve store order and stop expanding
"${array[@]}" based on the sorted order of the keys, then the slice
function can also be applied there. It's not essentially helpful but
there would be consistency between the indexed array and associative
array.

-- 
konsolebox



reply via email to

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