From: Mark Slagell Date: 2001-10-10T02:50:49+09:00 Subject: [ruby-talk:22325] blocks with min and max I don't know if this has been raised before, but I'd like to be able to supply a simpler block to min and max, taking one argument instead of two. Currently if objects of a class have some attribute, then finding the object with the smallest such attribute means doing something like this: largest = collection.max {|obj1, obj2| obj1.attrib <=> obj2.attrib} ... but this is characteristic of sorting logic, which does not presuppose an order. min and max have sufficient inherent meaning that it seems it should make sense to say largest = collection.max {|obj| obj.attrib} Of course it's not a big deal except when the attribute expression gets a little lengthy, as I came across in a recent project. Any thoughts? Mark