Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby 1.9 and the Queue class

Reply
Thread Tools

Ruby 1.9 and the Queue class

 
 
Aldric Giacomoni
Guest
Posts: n/a
 
      04-13-2009
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
 
Reply With Quote
 
 
 
 
Heesob Park
Guest
Posts: n/a
 
      04-13-2009
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

 
Reply With Quote
 
 
 
 
Aldric Giacomoni
Guest
Posts: n/a
 
      04-13-2009
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
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      04-13-2009
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
 
Reply With Quote
 
Saji N. Hameed
Guest
Posts: n/a
 
      04-14-2009
* Robert Klemme <(E-Mail Removed)> [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 http://www.velocityreviews.com/forums/(E-Mail Removed)
Fax: +82-51-745-3999




 
Reply With Quote
 
trans
Guest
Posts: n/a
 
      04-14-2009


On Apr 12, 9:54=A0pm, Heesob Park <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
Simple question about Queue.Queue and threads Frank Millman Python 3 02-09-2010 06:45 AM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
what's the difference between #include "queue.h" and #include "queue.cpp" Kceiw C++ 3 03-14-2006 03:01 AM
Queue.Queue-like class without the busy-wait Paul L. Du Bois Python 29 04-04-2005 01:28 PM



Advertisments