ara.t.howard / noaa.gov wrote:
> On Fri, 9 Dec 2005, robertj wrote:
>
> > is there anywhere a class that does soemthing
> > akin to java.util.SortedMap? that is sorting
> > and iterating over the hash in the order of its
> > keys.
> >
> > i had a look into facets dictionary but that does
> > only preserve the ordering of insertion which
> > is not what i want.
> >
> > any other suggestions?
> >
> > ciao robertj
>
>    harp:~ > cat a.rb
>    require "alib"
>    include ALib
>
>    oh = OrderedHash::new
>    oh["first"] = 42
>    oh["second"] = "forty-two"
>
>    puts "---"
>    oh.each{|k,v| puts "#{ k } : #{ v }"}
>
>    harp:~ > ruby a.rb
>    ---
>    first : 42
>    second : forty-two

Insertion order?

T.