Markus wrote: >>Well, at least you can do >> >>def SortedMap(h) >> # any transformation of a Hash that >> # does not depend on insertion order >> # for example >> h.sort >>end >> >>foo = SortedMap( "foo" => "bar", "two" => 2 ) >> >> > >The problem (at least as I understand it) with this approach is that >he's wanting them in INSERTION order; there is no guarantee that the the >hash that comes into SortedMap will be in insertion order, and I don't >see how the h.sort will fix that. > >-- MarkusQ > If you really want it in insertion order, just use an array. The only problem comes if you want it in two different orders, in which case you also need to build an index in the order that you desire (and deletions become problematical...i.e., you've got to ensure that the index stays in sync).