Subject: Sorting arrays problem
	Date: Sat 13 Sep 14 11:16:03PM -0400

Quoting Cyril Guirguis (c.guirguis / mail.utoronto.ca):

> Question #1:
>  - Why are we adding a .sort! method as well as doing ' fruit1 <=> fruit2
> '. It just seems like overkill to me; like we're doing it twice. Shouldn't
> ' fruits.sort! ' alone accomplish sorting the fruits into alphabetical
> order.

I do believe that the lesson would like to teach you about providing a
different comparison function to the sorting process. I.E, you can
write

fruits.sort! do |fruit1,fruit2|
  fruit2<=>fruit1
end	

and this spares you the need to add the call to .reverse. Look at the
output of

ri Array#sort

for a practical example. But I know nothing about the codecademy
compiler. 

Carlo

-- 
  *         Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido / fluido.as             che bisogno ci sarebbe
  *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu)