From: Just Another Victim of the Ambient Morality Date: 2006-08-22T06:00:24+09:00 Subject: Re: Why Does Hash Apparently Reorder Its Internal Representation And Other Associated Ponderings "Austin Ziegler" wrote in message news:9e7db9110608211246t5ba563e6sfc8ac48b3a5e517d@mail.gmail.com... > On 8/21/06, Just Another Victim of the Ambient Morality > wrote: >> I think what you are thinking of is a red black tree (or just a >> binary >> tree, in general) and not a hash... > > No, people are thinking of an associative array or an association list > as someone else called it in this thread. I'm not sure about r/b > trees, but binary trees are most *definitely* not what is wanted since > what is wanted is insertion order in most cases, not an arbitrary > sorted order. Ah, of course. I get the two (sorted order and insertion order) mixed up since they are both rather popular in terms of what people (surprisingly) expect of a hash... >> Honestly, complaining that hashes aren't ordered is like complaining >> that rand() doesn't return the same number every time. Pray tell, what >> made you think it should be ordered? That was an honest question, by >> the >> way! You know enough about programming to come here and decree that >> this >> is very weird yet you didn't already know what a hash is or how one >> works. >> Very strange... > > PHP's "array" is an associative array allowing "hash"-like handling > with an ordered iteration. That's probably the source of 99% of the > reasons that people want it. I see... This explains a lot, thank you...