Damien Neil <[EMAIL PROTECTED]> writes:

> Arrays are ordered.  Hashes are not.  Sure, you can iterate over a hash,
> but add an element to one and you can change the order of everything in
> it.

Formally, I believe it's permissable for a hash implementation to return a
different order the second time you iterate through it from the first
time, even if you haven't touched the hash inbetween.  That's the
definition of an iterable but unordered data structure; there's some way
of getting all of the members one and only one time, but each time you
look at it the order in which the members show up may be different (maybe
garbage collection happened behind the scenes, the hash was reorganized
due to an observation of how you were using it, etc.).

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to