This is a function that does some currying:
add = (a,b) -> if not b? return (c) -> c + a a + b
and to determine how many arguments were provided:
add = (a,b) -> if arguments.length < add.length return (c) -> c + a a + b
so it seems like it should be possible to write a function that magically returns a function that requires the right number of arguments. So I could have a function:
f = (a,b,c,d,e,f) -> ..
if invoked with:
it should return:
anyone know how to do that?
Lots of good comments on the original gist