2026年1月6日(火) 0:19 Chet Ramey <[email protected]>:
> [...]
>
> You might want to read Koichi's proposal.
>
> https://lists.gnu.org/archive/html/bug-bash/2025-12/msg00125.html

@Greg In particular, it is clear to read the pseudocode at the end of
the above link.

> It goes further than I'd like, in that his proposal supports subscripted
> array element assignment mixed with kvpair assignment. It doesn't propose
> to change how subcripted assignments work, or how to determine whether or
> not the compound assignment is subscripted or k-v pairwise assignment.

I think this is the only way that is consistent with the traditional
behavior of the compound list for the indexed arrays.

> > Maybe a new command like this would be the cleanest way forward.  A
> > bash equivalent might look something like:
> >
> >      loadarray assoc "${kv[@]}"
> >
> > Maybe add an option that'll clear any existing elements.
>
> This sounds like a loadable builtin, if someone wants to take a run at it.

Actually, users can implement these [1] as shell functions.

[1] Greg's `array' and `loadarray' suggested in
https://lists.gnu.org/archive/html/bug-bash/2026-01/msg00008.html

--
Koichi

        • R... Félix Hauri via Bug reports for the GNU Bourne Again SHell
          • ... Félix Hauri via Bug reports for the GNU Bourne Again SHell
          • ... Greg Wooledge
  • Re: Question a... Chet Ramey

Reply via email to