[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Fiber exists before require 'fiber'

Roger Pack

6/13/2008 7:16:00 PM


So, in 1.9 it appears that the Fiber class exists before you've required
fiber. Thoughts?

irb(main):001:0> Fiber
=> Fiber
irb(main):002:0> Fiber.current
NoMethodError: undefined method `current' for Fiber:Class
from (irb):2
from /Users/rogerpack/19/bin/irb:12:in `<main>'
irb(main):003:0> require 'fiber'
=> true
irb(main):004:0> Fiber.current
=> #<Fiber:0x11bb10>

And, oddly, only fiber.bundle exists, not fiber.rb

is this more like 'supplemental fiber methods' or something?
Anyway it works, I'm just curious.
Thanks!
-R
--
Posted via http://www.ruby-....

4 Answers

Dave Thomas

6/13/2008 7:21:00 PM

0


On Jun 13, 2008, at 2:16 PM, Roger Pack wrote:

> is this more like 'supplemental fiber methods' or something?
> Anyway it works, I'm just curious.

Without the require, you get asymmetric fibers: they're useful as
generators. With the require, you get symmetric ones, which are closer
to coroutines.


Dave

Avdi Grimm

6/13/2008 8:07:00 PM

0

On Fri, Jun 13, 2008 at 3:21 PM, Dave Thomas <dave@pragprog.com> wrote:
> Without the require, you get asymmetric fibers: they're useful as
> generators. With the require, you get symmetric ones, which are closer to
> coroutines.

Nope, that's not confusing at all! ;-)

--
Avdi

Home: http:...
Developer Blog: http:.../devblog/
Twitter: http://twitte...
Journal: http://avdi.livej...

vc

6/13/2008 8:30:00 PM

0

Roger Pack wrote:
> is this more like 'supplemental fiber methods' or something?

http://www.infoq.com/news/2007/08/ruby-...

--
http://s2.d...

Roger Pack

6/16/2008 8:00:00 PM

0

Dave Thomas wrote:
> On Jun 13, 2008, at 2:16 PM, Roger Pack wrote:
>
>> is this more like 'supplemental fiber methods' or something?
>> Anyway it works, I'm just curious.
>
> Without the require, you get asymmetric fibers: they're useful as
> generators. With the require, you get symmetric ones, which are closer
> to coroutines.
>
>
> Dave

Thanks that answered it.
-R
--
Posted via http://www.ruby-....