[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby 1.9 and the Queue class

aldric[removeme]

4/13/2009 1:13:00 AM

Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
$ irb
irb(main):001:0> a = Queue.new
NameError: uninitialized constant Queue
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0>

What gives ?
If I switch to Ruby 1.8 and do the same thing, I get a new queue..


--
Aldric Giacomoni<br>
The problem of leadership is inevitably: Who will play God?

-- Muad'Dib. From the Oral History
5 Answers

Heesob Park

4/13/2009 1:54:00 AM

0

2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:
> Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install=
).
> $ irb
> irb(main):001:0> a =3D Queue.new
> NameError: uninitialized constant Queue
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from (irb):1
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from /usr/bin/irb:12:in `<main>'
> irb(main):002:0>
>
> What gives ?
> If I switch to Ruby 1.8 and do the same thing, I get a new queue..
>
require 'thread' first.


Regards,

Park Heesob

aldric[removeme]

4/13/2009 2:47:00 AM

0

Ah-ha! Thank you!

--Aldric

Heesob Park wrote:
> 2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:
>> Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
>> $ irb
>> irb(main):001:0> a = Queue.new
>> NameError: uninitialized constant Queue
>> from (irb):1
>> from /usr/bin/irb:12:in `<main>'
>> irb(main):002:0>
>>
>> What gives ?
>> If I switch to Ruby 1.8 and do the same thing, I get a new queue..
>>
> require 'thread' first.
>
>
> Regards,
>
> Park Heesob
>

--
Aldric Giacomoni<br>
Governments, if they endure, always tend increasingly toward aristocratic forms.
No government in history has been known to evade this pattern. And as the
aristocracy develops, government tends more and more to act exclusively in
the interests of the ruling class -- whether that class be hereditary royalty,
oligarchs of financial empires, or entrenched bureaucracy.

-- Politics as Repeat Phenomenon: Bene Gesserit Training Manual

Robert Klemme

4/13/2009 11:30:00 AM

0

On 13.04.2009 03:12, Aldric Giacomoni wrote:
> Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
> $ irb
> irb(main):001:0> a = Queue.new
> NameError: uninitialized constant Queue
> from (irb):1
> from /usr/bin/irb:12:in `<main>'
> irb(main):002:0>
>
> What gives ?
> If I switch to Ruby 1.8 and do the same thing, I get a new queue..

Not for me:

robert@fussel ~
$ allruby -e 'p Queue'
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
-e:1: uninitialized constant Queue (NameError)
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
-e:1:in `<main>': uninitialized constant Queue (NameError)

robert@fussel ~
$ allruby -r thread -e 'p Queue'
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
Queue
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
Queue

robert@fussel ~
$

Do you maybe have some default require which requires "thread"?

Kind regards

robert


--
remember.guy do |as, often| as.you_can - without end

Saji N. Hameed

4/14/2009 4:38:00 AM

0

* Robert Klemme <shortcutter@googlemail.com> [2009-04-13 20:30:07 +0900]:

>> What gives ?
>> If I switch to Ruby 1.8 and do the same thing, I get a new queue..
>
> Not for me:
>
> robert@fussel ~
> $ allruby -e 'p Queue'
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
> -e:1: uninitialized constant Queue (NameError)
> ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
> -e:1:in `<main>': uninitialized constant Queue (NameError)
>
> Do you maybe have some default require which requires "thread"?

hmmm... not for me ;-(

ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
[saji@apcc08 Personal]$ ruby -e 'p Queue'
Queue

saji
--

--
Saji N. Hameed

APEC Climate Center
1463 U-dong, Haeundae-gu, +82 51 745 3951
BUSAN 612-020, KOREA saji@apcc21.net
Fax: +82-51-745-3999




Trans

4/14/2009 5:13:00 PM

0



On Apr 12, 9:54=A0pm, Heesob Park <pha...@gmail.com> wrote:
> 2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:> Using Gento=
o - just unmasked Ruby 1.9 and emerged it (aka compile/install).
> > $ irb
> > irb(main):001:0> a =3D Queue.new
> > NameError: uninitialized constant Queue
> > =A0 =A0 =A0 =A0from (irb):1
> > =A0 =A0 =A0 =A0from /usr/bin/irb:12:in `<main>'
> > irb(main):002:0>
>
> > What gives ?
> > If I switch to Ruby 1.8 and do the same thing, I get a new queue..
>
> require 'thread' first.

Seems like it would be good to put that in it's own require.

require 'queue'

And thread.rb can require that.

T.