From: Logan Capaldo Date: 2005-09-27T08:26:28+09:00 Subject: Re: Is there a hash-like class that maintains insertion order On Sep 26, 2005, at 2:33 PM, Kent Sibilev wrote: > You can also check out the red-black tree implementation at > http://raa.ruby-lang.org/project/ruby-rbtree/ > > Kent. > This is not quite what he needs. A red-black tree is sort of like a Sorted Hash, it doesn't maintain insertion order. eg. a = InsertionOrderedHash.new a[3] = "one" a[1] = "two" a[2] = "three" a.each do |x| puts x end one two three b = RedBlackTree.new a[3] = "one" a[1] = "two" a[2] = "three" b.each do |x| puts x end two three one