On Mar 11, 2008, at 3:43 AM, Peter Hug wrote:

> What I really would like is an array that is always ordered. IOW, I  
> want
> the object to be inserted at the correct location inside the array  
> when
> the object is added to the array.
>
> Is there an efficient way to do this?

You could use a priority queue.  You can see some pure Ruby code for  
this in an old Ruby Quiz:

http://www.rubyquiz.com/quiz40.html

James Edward Gray II