Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2011 01:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1225837 to your computer and use it in GitHub Desktop.
Save anonymous/1225837 to your computer and use it in GitHub Desktop.
l = ->(a = 'ichi', b = 'ni', c = 'san') { puts "#{a}, #{b}, #{c}" }
p l.arity # => -1 in JRuby, 0 in MRI...no good answer
def l.arity; 3; end # force to "3" so curry delays evaluation
c = l.curry
c.('one').('two').('three') # => one, two, three
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment