Sha256: 1e65682ab777158b97d02416cc9850c19cab98eb282a159a987101552659c1f8

Contents?: true

Size: 186 Bytes

Versions: 10

Compression:

Stored size: 186 Bytes

Contents

def open_box(continuation)
  continuation.call if rand < 0.5
end

callcc do |continuation|
  puts "opening box"
  open_box(continuation)
  puts "Phew--kitty's OK"
end

puts "closing box"

Version data entries

10 entries across 10 versions & 5 rubygems

Version Path
brandon-codex-1.0.3 app_generators/codex/templates/code/control/basic_continuation.rb
drnic-codex-1.0.0 app_generators/codex/templates/code/control/basic_continuation.rb
drnic-codex-1.0.1 app_generators/codex/templates/code/control/basic_continuation.rb
drnic-codex-1.0.2 app_generators/codex/templates/code/control/basic_continuation.rb
pragdave-codex-1.0.3 app_generators/codex/templates/code/control/basic_continuation.rb
tobias-codex-1.0.3 app_generators/codex/templates/code/control/basic_continuation.rb
codex-1.1.2 app_generators/codex/templates/code/control/basic_continuation.rb
codex-1.1.1 app_generators/codex/templates/code/control/basic_continuation.rb
codex-1.1.0 app_generators/codex/templates/code/control/basic_continuation.rb
codex-1.0.2 app_generators/codex/templates/code/control/basic_continuation.rb