Skip to content

Instantly share code, notes, and snippets.

@scdekov
Created January 28, 2019 15:07
Show Gist options
  • Save scdekov/db115f7708e068b32f179aa0c310765b to your computer and use it in GitHub Desktop.
Save scdekov/db115f7708e068b32f179aa0c310765b to your computer and use it in GitHub Desktop.
def curry(func, *args)
def wrapped(*new_args)
args = args.concat new_args
if args.length == func.arity
func.call(*args)
else
curry func, args
end
end
end
def a(b, c)
puts called
end
result = curry method(:a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment