[Top][All Lists]

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

Re: [Help-bash] Order of element in associative array expansion

From: Chet Ramey
Subject: Re: [Help-bash] Order of element in associative array expansion
Date: Thu, 17 Oct 2013 15:24:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1

On 10/17/13 12:23 PM, Davide Brini wrote:
> I know that the order of keys and values obtained by expanding an
> associative array with "address@hidden" and "address@hidden" respectively is
> unpredictable, which is fine.
> However my question is: at a given point in time, without changes or other
> operations happening in between, are the two expansions guaranteed to
> return the keys in the same order as the respective values and viceversa?

Yes, the current implementation walks the hash table of keys and values
in the same way for both expansions.  Frankly, I don't see that changing
unless I significantly change the internal representation.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden

reply via email to

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