From: "David A. Black" Date: 2008-01-10T20:16:08+09:00 Subject: Re: Array#count returning an enumerator Hi -- On Thu, 10 Jan 2008, Yukihiro Matsumoto wrote: > Hi, > > On Jan 9, 2008 11:39 AM, David A. Black wrote: > >> I'm not sure what the purpose is of having count without an argument >> return an enumerator. It doesn't seem to do anything that #each >> doesn't do, and it doesn't relate to the semantics of count(n). >> >> Are there use cases I'm not seeing? > > Something like: > > ary.count.with_index{|x,i|...} What does that give you that's different from ary.each.with_index? David -- Training for 2008! Ruby on Rails training by David A. Black/Ruby Power and Light, LLC: * Intro to Rails, New York, NY, February 4-7 2008 * Advancing With Rails, New York, NY, February 11-14 2008 Hosted by Exceed Education. See http://www.rubypal.com for details!