4 ms·
The prototype source[1] has the answer, and it does not curry the function. In fact it does not even perform real partial application. It just returns a closure
by sjs 17y ago
The prototype source[1] has the answer, and it does not curry the function. In fact it does not even perform real partial application. It just returns a closure that has references to the original function and the argument(s) you asked it to partially apply. When you call the resulting function it merges the new arguments and calls the original function.
[1] http://github.com/sstephenson/prototype/blob/master/src/lang/function.js http://github.com/sstephenson/prototype/blob/master/src/lang...
Conceptually it's the same as partial application so most of us would overlook that detail, but it is nowhere near currying. See Haskell if you're interested in these concepts.