"Kroeger, Simon (ext)" <simon.kroeger.ext / siemens.com> writes:

> Well, Enumerable#max is the way to go here, but inject isn't 
> that clumsy too:
> longest = data.inject{|max, this| this.length > max.length ? this : max}

  longest = data.inject{|max, this| [this.length, max.length].max }

;-)  (That's how they do it in APL too, btw.)

-- 
Christian Neukirchen  <chneukirchen / gmail.com>  http://chneukirchen.org