Where oh where is Enumerator? (1.9)

Err... in Ruby 1.9 is Enumerator at the toplevel or in the Enumerable
namespace? Seems to me it was moved to the toplevel at one point, but
now it looks like it's in Enumerable again... then again I may have
that all backwards. Can someone confirm?

Thanks.

Hi --

Err... in Ruby 1.9 is Enumerator at the toplevel or in the Enumerable
namespace? Seems to me it was moved to the toplevel at one point, but
now it looks like it's in Enumerable again... then again I may have
that all backwards. Can someone confirm?

I don't think it's back in Enumerable:

irb(main):007:0> RUBY_DESCRIPTION
=> "ruby 1.9.2dev (2009-08-22 trunk 24620) [i686-linux]"
irb(main):008:0> Enumerable::Enumerator
NameError: uninitialized constant Enumerable::Enumerator
   from (irb):8
   from /usr/local/lib/ruby-snapshot/bin/irb:12:in `<main>'
irb(main):009:0> Enumerable
=> Enumerable

(Courtesy of ruby-versions.net and its nightly trunk snapshots :slight_smile:

David

···

On Sat, 22 Aug 2009, Intransition wrote:

--
David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com
Q: What's the best way to get a really solid knowledge of Ruby?
A: Come to our Ruby training in Edison, New Jersey, September 14-17!
    Instructors: David A. Black and Erik Kastner
    More info and registration: http://rubyurl.com/vmzN

$ ruby19 -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin8.11.1]

$ ruby19 -e 'x = Enumerable::Enumerator'
-e:1:in `<main>': uninitialized constant Enumerable::Enumerator
(NameError)

$ ruby19 -e 'x = Enumerable'
$

···

--
Posted via http://www.ruby-forum.com/.

irb(main):009:0> Enumerable

$ ruby19 -e 'x = Enumerable'
$

guys, shouldn't that be Enumerator?

Thanks!

···

On Aug 22, 10:28 am, "David A. Black" <dbl...@rubypal.com> wrote:

Hi --

On Sat, 22 Aug 2009, Intransition wrote:
> Err... in Ruby 1.9 is Enumerator at the toplevel or in the Enumerable
> namespace? Seems to me it was moved to the toplevel at one point, but
> now it looks like it's in Enumerable again... then again I may have
> that all backwards. Can someone confirm?

I don't think it's back in Enumerable:

Fabian Streitel wrote:

irb(main):009:0> Enumerable

$ ruby19 -e 'x = Enumerable'
$

guys, shouldn't that be Enumerator?

Yes.

$ ruby19 -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin8.11.1]

$ ruby19 -e 'x = Enumerable::Enumerator'
-e:1:in `<main>': uninitialized constant Enumerable::Enumerator
(NameError)

$ ruby19 -e 'x = Enumerator'
$

···

--
Posted via http://www.ruby-forum.com/.

Hi --

···

On Sun, 23 Aug 2009, Fabian Streitel wrote:

irb(main):009:0> Enumerable

$ ruby19 -e 'x = Enumerable'
$

guys, shouldn't that be Enumerator?

Whoops, yes :slight_smile:

irb(main):001:0> Enumerator
=> Enumerator

David

--
David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com
Q: What's the best way to get a really solid knowledge of Ruby?
A: Come to our Ruby training in Edison, New Jersey, September 14-17!
    Instructors: David A. Black and Erik Kastner
    More info and registration: http://rubyurl.com/vmzN