Skip to content

Instantly share code, notes, and snippets.

@snuxoll
Forked from banister/gist:84288
Created March 24, 2009 18:53
Show Gist options
  • Save snuxoll/84291 to your computer and use it in GitHub Desktop.
Save snuxoll/84291 to your computer and use it in GitHub Desktop.
module YCombinator
def y_comb(&generator)
proc { |x|
proc { |*args|
generator.call(x.call(x)).call(*args)
}
}.call(proc { |x|
proc { |*args|
generator.call(x.call(x)).call(*args)
}
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment