From: Gennady Date: 2003-12-20T08:59:13+09:00 Subject: Re: Could I have an example of using Continuations as 'co-routines'? On Dec 19, 2003, at 15:21, Asfand Yar Qazi wrote: > Hi, > > I've been hanging around on the irc channel recently, getting advice > to reimplement my incomplete C++ game engine in Ruby (I've redone > about 2 weeks work in 2 days!) > > Here's my problem: instead of using setjmp/longjmp to script my game's > story-line (scripting in C++, tut-tut, what was I thinking?!), I > obviously want to use a Ruby feature, and I assume Continuations are > the thing to do it. > > But I don't understand how! My mind is just going upside-down > (perhaps I need to give coding a break for a day or two...) > > Anyway, could I have a simple example to start with? > I hope this will help: http://www.eleves.ens.fr/home/madore/computers/callcc.html Also the Pickaxe has some basic examples (you may have seen them already, though): http://www.ruby-doc.org/docs/ProgrammingRuby/html/ ref_c_continuation.html Sincerely, Gennady Bystritsky