From: Markus Date: 2004-09-18T06:56:11+09:00 Subject: Re: Accessing Hash elements in sorted order? On Fri, 2004-09-17 at 13:08, Hal Fulton wrote: > Markus wrote: > > On Fri, 2004-09-17 at 12:14, Chris wrote: > > > >>>There has been some discussion going on whether Ruby's Hash should be > >>>sorted by default on this list recently. > >>> > >> > >>I would vote in favor of it. > > > > > > I'd vote against, for the following reasons. > > > > 1. Every time it comes up the thread goes quite a while before the > > advocates realize that they aren't all assuming the same sorting > > order. Some are thinking "sorted by key (obviously)" while > > others are thinking "sorted by order of insertion (obviously)" > > and still others are thinking "sorted by value" or "sorted by > > some arbitrary key so long as it's consistent," etc. > > Let's distinguis between "sorted" and "ordered." If it's ordered, you > can sort it however you like. Agreed (as a terminology distinction), with the caveat that "you can sort it however you like" is subject to some reasonablity restrictions. -- Markus