From: Ara.T.Howard@... Date: 2004-09-06T13:10:12+09:00 Subject: Re: OK... :) question about hash and array literals On Mon, 6 Sep 2004, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: OK... :) question about hash and array literals" > on Mon, 6 Sep 2004 08:50:15 +0900, Bill Guindon writes: > > |Personally, I'd like it to remember the order you added things in, use > |that ordering when iterating through the hash, and _optionally_ use it > |for compares. > > Hmm, I thought hash order would be ignored always for compares. > Optional use of order is an interesting idea, although I want better > looking API than > > | {1=>2, 3=>4}.ordered != {3=>4, 1=>2}.ordered > > matz. this is a GREAT idea! i've always thought that there is no reason hashes could not simply remember the order of inserts and use it. as far as comparisons i would agree they should not be ordered in general, perhaps hash.identical other or something that did depend on order. one of the coolest things about ordered hashes would be their use with yaml! i use yaml configs and the lack of hash ordering is a constant pain in my side. how difficult do you think it would be to add order memory for hash insert operations and to use it for each/map, etc.? -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================