Lars Haugseth wrote in post #1066738:
> The only time the array is referenced later in the method is when you
> partition all except the first element, so it makes perfect sense to me.

I'm talking about the original array you want to sort. When you pass it 
to the method, it will lose its first element:

my_array = [3, 1, 5, 2]
sorted = quicksort(my_array)  # get a sorted copy
p my_array  # WTF? my_array has suddenly become [1, 5, 2]

I'd actually call this a bug. The method should either sort the original 
array, or it should not touch the original array at all and only return 
a new sorted array. I think the second option makes more sense for a 
function style method.

But your method would return a new sorted array and at the same time 
somewhat corrupt the original one.

-- 
Posted via http://www.ruby-forum.com/.