Created
January 19, 2026 06:37
-
-
Save Animesh-Ghosh/4c758cf13ef6b8777c7f294ff4aa39c7 to your computer and use it in GitHub Desktop.
Bangalore Ruby User Group Jan 2026 Continuation "talk" content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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