Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?
Yes, in most cases. MRI (1.8) have supported them as far as my memory reaches, Ruby 1.9 (YARV) does it, too, so does Rubinius. JRuby and IronRuby don't have continuations, and it's quite unlikely they will get them (JVM and CLR use stack-instrospection for security)
Ruby as a language supports continuations via callcc
keyword. They're used, for example, to implement Generator
class from standard library.
continuations on ruby-doc
Continuation-based web frameworks (like seaside, or one from Arc's std. library) seem less popular. I've found wee that claim to let you do optional continuations, but I've never used it.
As others have said already, Ruby 1.8 supports continuations.
Ruby 1.9 has not supported them for a while however. They have been added back some time this year, but most of the other Ruby interpreters (JRuby, IronRuby, etc) don't support them.
If you want your code to be usable on other platforms than the mainline Ruby, I'd suggest not using them.
Read this InfoQ article for a more comprehensive discussion on the topic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With