Hi --

I'm wondering about this:

irb(main):007:0> a = [1,2,3,4]
=> [1, 2, 3, 4]
irb(main):008:0> c = a.count
=> #<Enumerable::Enumerator:0x5421a8>
irb(main):009:0> c.next
=> 1
irb(main):010:0> c.next
=> 2
irb(main):011:0> c.to_a
=> [1, 2, 3, 4]

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?


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!