From: dblack@... Date: 2007-06-29T19:57:24+09:00 Subject: Re: Array Problem, sort Array ---2049402039-2137031982-1183114646=:6116 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-2137031982-1183114646=:6116" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-2137031982-1183114646=:6116 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Fri, 29 Jun 2007, Pe=F1a, Botp wrote: > On Behalf Of dblack@wobblini.net: > # hat about: > # class C; end > # [C.new].sort > # ? > > or maybe, > [complex_objects].sort > > i really avoid threading such complex objects to sort, though things > like that can be handled by sort_by or plain sort{0}. > > What i'm concerned at is nil, since it's one of the most common object re= turned. But it's a question of whether <=3D> is defined or not, so C.new is in exactly the same position as nil. So the question is: if [C.new] (one-element array) "sorts", why should [nil] not "sort"? David --=20 * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com) ---2049402039-2137031982-1183114646=:6116-- ---2049402039-2137031982-1183114646=:6116--