From: "David A. Black" Date: 2009-02-10T21:53:32+09:00 Subject: Re: a better way to do this job? Hi -- On Tue, 10 Feb 2009, 7stud -- wrote: > In my opinion, it's nicer than the first version because it doesn't have > to create a sub array in memory, like all the solutions posted so far > do, which could be a problem with large arrays and large slices. Ryan had something like: topics.first(5).each do |t| puts t.title end which, I believe, does not create an intermediate array because topics.first(5) returns an enumerator. 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!