Search code examples
rubycontinuations

Continuations in Ruby


Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?


Solution

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