From: Christian Neukirchen Date: 2006-05-25T04:46:29+09:00 Subject: Re: rubynuby - confused by method name "inject" "Kroeger, Simon (ext)" 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 http://chneukirchen.org