From: "David A. Black" Date: 2009-02-11T05:13:27+09:00 Subject: Re: a better way to do this job? Hi -- On Wed, 11 Feb 2009, Ryan Davis wrote: > > On Feb 10, 2009, at 04:21 , Julian Leviston wrote: > >> First doesn't take an argument I'm ruby. It does >> If you're using rails enumerable mixin > > > David showed it in 1.9... but I had to point this out: > > % ruby -ve 'puts [1,2,3,4].first(2)' > ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] > 1 > 2 > > this goes back to at least 1.7 iirc. #first was introduced in 1.6 and 1.7 > gave it an optional length arg. I've clearly got 1.9 on the brain :-) David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) http://www.wishsight.com => Independent, social wishlist management!