From: Curt Sampson Date: 2008-02-07T12:05:41+09:00 Subject: Re: Array Practice On 2008-02-07 11:47 +0900 (Thu), Charles Snider wrote: > one line (36 chars) with uniq, map, and select Note that, given the output specification, I wonder if it isn't important that the input objects themselves be preserved in the output array. I did a test for that: class AlwaysEqual def ==(o); true; end def hash; 0; end end def test_group_references a = AlwaysEqual.new b = AlwaysEqual.new r = group([a, b]) assert_equal([[a, b]], r) assert_same(a, r[0][0]) assert_same(b, r[0][1]) end cjs -- Curt Sampson +81 90 7737 2974 Mobile sites and software consulting: http://www.starling-software.com