Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2014 05:59
Show Gist options
  • Save anonymous/11243101 to your computer and use it in GitHub Desktop.
Save anonymous/11243101 to your computer and use it in GitHub Desktop.
one = ->(x=->{1}) {(x.kind_of?(Array)) ? (x[0].call(x[1],one.call)) : ->{1}}
plus = ->(lhs, rhs = nil) { rhs.nil? ? (return [plus, lhs]) : (return (lhs.call + rhs.call))}
one.call(plus.call(one.call))
#=> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment