Infinite streams in ruby 1.9?

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


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On Dec 5, 2007, at 11:26 AM, Giles B. 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/software/lazy.rb/

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

James Edward G. II

On Dec 5, 11:26 am, Giles B. [email protected] wrote:

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


Giles B.

Podcast:http://hollywoodgrit.blogspot.com
Blog:http://gilesbowkett.blogspot.com
Portfolio:http://www.gilesgoatboy.org
Tumblelog:http://giles.tumblr.com

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

On Thu, 6 Dec 2007 03:00:25 +0900, MonkeeSage [email protected]
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

On Dec 5, 11:38 am, James G. [email protected] wrote:

http://moonbase.rydia.net/software/lazy.rb/

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

James Edward G. II

Neat article, James! :slight_smile:

Regards,
Jordan

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

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs