Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@padde
Created June 4, 2014 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padde/e0468d0988bd96a2907a to your computer and use it in GitHub Desktop.
Save padde/e0468d0988bd96a2907a to your computer and use it in GitHub Desktop.
require 'continuation'
$__labels__ = {}
def label(label)
callcc {|cc| $__labels__[label] = cc }
end
def goto(label)
$__labels__[label].call
end
def a
label :c
puts 'i call b'
b
end
def b
puts 'i goto c'
goto :c
end
a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment