-
-
Save scdekov/db115f7708e068b32f179aa0c310765b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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