From: Mark Slagell Date: 2001-10-10T04:06:26+09:00 Subject: [ruby-talk:22334] Re: blocks with min and max Yukihiro Matsumoto wrote: > ... > Enumerable#min and #max already work like the former, i.e. > > largest = collection.max {|obj1, obj2| obj1.attrib <=> obj2.attrib} > > But I now think I should have chosen the latter. To belabor the point a little, by 'attribute' I don't necessarily mean just consulting an accessor. The redundancy hadn't bothered me until I found myself writing this, split_atr = attributes.min do |a1,a2| expected_info_content(split(a1)) <=> expected_info_content(split(a2)) end when this was the natural thing to say. split_atr = attributes.min {|a| expected_info_content(split(a))} Guess I could choose shorter method names. :-) Mark