Skip to content

Instantly share code, notes, and snippets.

@visibletrap
Created June 26, 2012 15:35
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 visibletrap/2996465 to your computer and use it in GitHub Desktop.
Save visibletrap/2996465 to your computer and use it in GitHub Desktop.
sum
sum = ->x,y,z { x + y + z }.curry
puts sum[2][3][4]
=> 9
sum = -> x { -> y { -> z { x + y + z } } }
puts sum[2][3][4]
=> 9
def sum(x,y,z)
x+y+z
end
puts sum(2,3,4)
=> 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment