# code from http://www.ruby-doc.org/core-2.0.0/Continuation.html # Here, the continuation serves as a loop require "continuation" arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ] c = callcc {|cc| cc} puts c message = arr.shift puts message c.call(c) unless message =~ /Max/ # Experiment with changing the argument passed to cc.call on the last line. # Change it to nothing (nil), to 0, and to "foo". What happens and why?