Created
July 23, 2014 20:09
-
-
Save eatnumber1/2b6886e3de3f03fda0c4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'continuation' | |
def newG(prefix = 'g') | |
proc do |tail = nil| | |
str = prefix | |
cont = nil | |
callcc{ |cc| cont = cc } | |
if tail == nil | |
str += 'o' | |
newG(str) | |
else | |
str += tail | |
end | |
end | |
end | |
g = newG() | |
puts g.call().call().call('al') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good point, it's not.