From: Ross Bamford Date: 2006-02-05T10:28:19+09:00 Subject: Re: continuation On Sun, 05 Feb 2006 02:49:58 -0000, Sch端le Daniel wrote: > irb(main):005:0* cnt=0 > => 0 > irb(main):006:0> cc=nil > => nil > irb(main):007:0> callcc {|cc|} > => nil > irb(main):008:0> cnt+=1 > => 1 > irb(main):009:0> cc.call if cnt < 10 > => nil > irb(main):010:0> cnt > => 1 > irb(main):011:0> > irb(main):012:0* RUBY_VERSION > => "1.8.4" > irb(main):013:0> > > this example is from > http://www.rubygarden.org/ruby?Continuations > and cnt should become 10 > I've found that certain things like continuations don't work well under IRB. I think it's because of the way it's workspaces work. That code works fine as a script. -- Ross Bamford - rosco@roscopeco.remove.co.uk