File: continuation.rb

Project: Invitation to Ruby

#!/usr/bin/env ruby

puts "First Example"
value = callcc { |continuation|
  continuation.call
  puts "Never Called"
}
puts "Continuing"

puts
puts "Second Example"
p = callcc { |continuation| continuation }
puts "Again ..."
p.call(proc { puts "The End" })


[ Index ][ Table of Contents ]
Generated by [ source2html ]