From: Kristof Bastiaensen Date: 2004-04-12T21:44:20+09:00 Subject: Re: Continuation usage On Mon, 12 Apr 2004 13:36:13 +0200, Patrick Roemer wrote: > Your version looks really nice. I think it could fit nicely with the > other continuation examples in the Ruby FAQ. Thanks. > Thanks! Maybe you are interested in the following code (if it doesn't exist already). In implements a kind of goto: class Mark def initialize @cc = callcc { |cc| cc } end def goto #should be called teleport @cc.call(@cc) end end #-- (the example is quite stupid, but just to show the concept) irb(main):006:0> begin irb(main):007:1* a = Mark.new irb(main):008:1> a.goto if gets.chomp != "stop" irb(main):009:1> end Hi, there Everything ok! stop nil irb(main):010:0> #----