From: Trans Date: 2006-08-13T08:05:11+09:00 Subject: Re: PATCH to make internal Hash class retain order... Robert Klemme wrote: > Adding to David's comments: you're changing semantics of one of the core > classes which is in itself a dangerous thing. Plus, you increase the > memory footprint of a hash which is IMHO a very bad idea for such a > widely used data structure (and some of these hashes grow huge). So, if > you want to patch ruby core, make it at least a subclass of Hash so > people can choose. > > Then of course there's a whole bunch of other things that one should > consider. Is the name properly chosen? Do we have to provide a means > for the user to *define* the standard order on creation? This is e.g. > the way Java's TreeSet works - and IMHO it's superior vs. having to call > order! manually. etc. All good points. I still think it would be nice if such a class were built-in to Ruby with literal: [ :a => 1, :b => 2 ] Maybe as a red-black tree class. T.