On Tue, 2003-05-27 at 17:35, Hal E. Fulton wrote:

> An overall better approach might be a SortedArray
> inheriting from Array -- it could even have its own
> definitions of << and so on that would preserve
> sorting. And the method of sorting would (could/
> should/might?) be fixed on an instance basis.

I'm not sure that a SortableArray is substitutable for a normal array. 
When I use an array, I expect the following ...

    a[5] = 10
    assert_equal 10, a[5]

A sorted array might not even support the []= operation, or if it does,
it would have to move the inserted to its correct position (and violate
the expectation above).

If you are considering sorted containers, I suggest a good look at
either the Smalltalk library, or the Eiffel library to see how they
approach the problem.  Both are well designed.

-- 
-- Jim Weirich     jweirich / one.net    http://jimweirich.umlcoop.net
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct, 
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)