Skip to content

Instantly share code, notes, and snippets.

@Animesh-Ghosh
Created January 19, 2026 06:37
Show Gist options
  • Select an option

  • Save Animesh-Ghosh/4c758cf13ef6b8777c7f294ff4aa39c7 to your computer and use it in GitHub Desktop.

Select an option

Save Animesh-Ghosh/4c758cf13ef6b8777c7f294ff4aa39c7 to your computer and use it in GitHub Desktop.
Bangalore Ruby User Group Jan 2026 Continuation "talk" content
require 'continuation'
# basic stuff
# puts 1 + callcc { |k| k.call(1) + 1 }
# neat stuff
# behaves differently in IRB 👀
$cc = nil
i = 0
foo = 1 + callcc do |k|
$cc = k
2 + k.call(3)
end
i += 1
puts "i = #{i}"
puts "foo = #{foo}"
$cc.call(5) if i < 10
# puts RubyVM::InstructionSequence.disasm(foo)
puts "ended"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment