On Thu, Oct 19, 2006 at 10:50:30PM +0900, Rick DeNatale wrote:
> As for actually renaming Enumerator to DelayedCollection, I'm not so
> enamored of that, since again, I don't think that breaking old code
> unnecessarily is a good thing, and Enumerator is already there albeit
> part of the standard library rather than the core, but aside from not
> needing the require 'enumerator' I appears to look pretty much the
> same between 1.8 and 1.9.
> 
> Now I suppose that my argument could be turned against having these
> methods returning an enumerator when a block is not given is a change
> from 1.8. But I can't think of how the old behavior was useful.  Maybe
> it's a lack of imagination on my part.  In any case, the 1.8 behavior
> seems to be inconsistent anyway.
> 
> $ irb
> irb(main):001:0> {}.each_key
> => {}
> irb(main):002:0> {}.each
> => {}
> irb(main):003:0> [].each
> => []
> irb(main):004:0> "abc".each
> LocalJumpError: no block given
>        from (irb):4:in `each'
>        from (irb):4

well,

irb(main):001:0> [1].each
LocalJumpError: no block given
	from (irb):1:in `each'
	from (irb):1
	from :0
irb(main):002:0> "".each
=> ""
irb(main):003:0> {1,1}.each
LocalJumpError: no block given
	from (irb):3:in `each'
	from (irb):3
	from :0

-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby