Where oh where is Enumerator? (1.9)

I

Intransition

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.
 
D

David A. Black

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 :)


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
 
7

7stud --

$ 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'
$
 
F

Fabian Streitel

[Note: parts of this message were removed to make it a legal post.]
irb(main):009:0> Enumerable


$ ruby19 -e 'x = Enumerable'
$

guys, shouldn't that be Enumerator?
 
7

7stud --

Fabian said:
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'
$
 
D

David A. Black

Hi --

guys, shouldn't that be Enumerator?

Whoops, yes :)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top