rb_delimcc adds support for delimited continuations build upon callcc.
rb_delimcc is available via rubygems.org and be installed using rubygems:
$ gem install rb_delimcc
-
get the source
-
from github:
$ git clone git://github.com/urso/rb_delimcc.git
-
or download zip file from https://github.com/urso/rb_delimcc/zipball/master
-
or download tarball from https://github.com/urso/rb_delimcc/tarball/master
-
-
install the gem (in source directory):
$ gem build rb_delimcc.gemspec $ sudo gem install rb_delimcc
To use rb_prob you need to use rubygems and require the library:
require 'rubygems'
require 'delimcc'
include DelimCC # optional, but will save some typing
The only functions you will need are 'reset' and 'shift'.
some simple examples can be found in examples/testcc.rb . Just run the file with 'ruby testcc.rb', to find out how delimcc works.
delimcc is build upon callcc, so if your ruby implementation of choice has no proper call/cc support build in, delimited continuations won't work then.