Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15323

Re: Associative array entries order differs from declaration

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Associative array entries order differs from declaration
Date 2019-08-15 11:32 -0400
Message-ID <mailman.169.1565883131.30381.bug-bash@gnu.org> (permalink)
References <71660c94-58cc-c87f-9e5f-c0aa32013097@noiraude.net> <20190815153200.GQ1218@eeg.ccf.org>

Show all headers | View raw


On Thu, Aug 15, 2019 at 05:26:03PM +0200, Léa Gris wrote:
> Is there a way to control the order of entries in an associative array?

No.

> What rules applies to the order of entries?

None.

If you require both an associative array and an ordered list, then you
will need two different data structures for that.  The ordered list may
be implemented as an indexed array, which preserves ordering.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Associative array entries order differs from declaration Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-15 11:32 -0400

csiph-web