On Aug 28, 2006, at 12:18 PM, Matt Diephouse wrote:

I would like to add some sort methods as well: quicksort(),
mergesort(), etc. But as methods, there is potential for these to end
up in a user-visible space.

Say for example, that I add a mergesort method to AbstractPMCArray.
Ruby's array class wouldn't be able to use AbstractPMCArray as a base
class because there is no mergesort method on an Array in Ruby.

Any thoughts?

How about requiring array classes to implement swap(), and then implementing sort algorithms in terms of that, as in C++?

Josh


Reply via email to