Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
catch throwを使った時の大域脱出
catch (:escape) do
loop do
puts 'loop1'
loop do
puts 'loop2'
throw (:escape, 'escape loop1 & loop2)
end
end
end
# => loop1
# => loop2
# => escape loop1 & loop2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.