From: "David A. Black" Date: 2005-07-16T21:17:18+09:00 Subject: Re: Cascading <=> comparisons Hi -- On Sat, 16 Jul 2005, Robert Klemme wrote: > This technique can be applied to sort_by, too: > >>> hash.sort_by {|a| a.reverse} > => [["a", 1], ["d", 1], ["c", 3], ["b", 4]] > > But this shows a strange anomaly - this seems like a bug in 1.8.2. > >>> hash.sort_by {|a| a.reverse!} > => [[1, "a"], [1, "d"], [3, "c"], [4, "b"]] I'll probably figure this out as soon as I hit 'send'... but what's the anomaly here? David -- David A. Black dblack@wobblini.net