From: Trans Date: 2005-12-09T04:22:36+09:00 Subject: Re: ordered/sorted hash robertj wrote: > another idea would be to be able to define > a comperator block that does the actual > comparisson. I see. So you want a way to tell the object itself how it's to order the elements. The default wprobably should stay insertion order, but you'd like to specify an alternative like alpahnumeric key order. Is that right? If so, I can put in an optional parameter for that no problem. Although you may have to set it post instantiation, something like d = Dictionary.new.sort_on { |a,b| a.key <=> b.key } As a shorthand: d = Dictionary.new.sort_on(:key) While I would like to add this as a block/parameter of the initialize method itself, it may be a problem b/c this should probably be used for a default block like hash has. T.