[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

infinite streams in ruby 1.9?

Giles Bowkett

12/5/2007 5:26:00 PM

with continuations going away, what's a good way to do infinite streams?

--
Giles Bowkett

Podcast: http://hollywoodgrit.bl...
Blog: http://gilesbowkett.bl...
Portfolio: http://www.gilesg...
Tumblelog: http://giles....

5 Answers

James Gray

12/5/2007 5:39:00 PM

0

On Dec 5, 2007, at 11:26 AM, Giles Bowkett wrote:

> with continuations going away,

Continuations are available in Ruby 1.9 after requiring a standard
library.

> what's a good way to do infinite streams?

Some thoughts:

http://moonbase.rydia.net/softwar...

http://blog.grayproductions.net/articles/infini...

James Edward Gray II

MonkeeSage

12/5/2007 5:58:00 PM

0

On Dec 5, 11:26 am, Giles Bowkett <gil...@gmail.com> wrote:
> with continuations going away, what's a good way to do infinite streams?
>
> --
> Giles Bowkett
>
> Podcast:http://hollywoodgrit.bl...
> Blog:http://gilesbowkett.bl...
> Portfolio:http://www.gilesg...
> Tumblelog:http://giles....

They're not gone in 1.9, just in their own module (continuation.rb).
Depending on what you mean by infinite streams (do you mean like an
infinite list of integers, or something else?), I'm sure a generator
would work.

Regards,
Jordan

MenTaLguY

12/5/2007 6:12:00 PM

0

On Thu, 6 Dec 2007 03:00:25 +0900, MonkeeSage <MonkeeSage@gmail.com> wrote:
> They're not gone in 1.9, just in their own module (continuation.rb).
> Depending on what you mean by infinite streams (do you mean like an
> infinite list of integers, or something else?), I'm sure a generator
> would work.

A generator may also yield (no pun intended) better performance than
a generalized implicit continuation.

-mental


MonkeeSage

12/5/2007 6:14:00 PM

0

On Dec 5, 11:38 am, James Gray <ja...@grayproductions.net> wrote:
> On Dec 5, 2007, at 11:26 AM, Giles Bowkett wrote:
>
> > with continuations going away,
>
> Continuations are available in Ruby 1.9 after requiring a standard
> library.
>
> > what's a good way to do infinite streams?
>
> Some thoughts:
>
> http://moonbase.rydia.net/softwar...
>
> http://blog.grayproductions.net/articles/infini...
>
> James Edward Gray II

Neat article, James! :)

Regards,
Jordan

Giles Bowkett

12/5/2007 10:41:00 PM

0

> They're not gone in 1.9, just in their own module (continuation.rb).

oh yeah! awesome.

> Depending on what you mean by infinite streams (do you mean like an
> infinite list of integers, or something else?), I'm sure a generator
> would work.

yeah, it's a list of numbers, one ints one floats iirc, but if if I can just

require 'continuations'

then boom, I'm good.

--
Giles Bowkett

Podcast: http://hollywoodgrit.bl...
Blog: http://gilesbowkett.bl...
Portfolio: http://www.gilesg...
Tumblelog: http://giles....