> Someday I would like to write up how do use continutations to do this,
> but this note is already too long.  Suffice it to say that we can use
> continuations to implement generator capability in about 20 lines of
> code.

See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/67063 for one 
such (not so perfect) example and the responses for interesting comments, 
improvements and better solutions.

Hans J?rg Hessmann