jashkenas/underscore — pull request #1318 by smelnikov (2013-10-22 01:29:53+00:00)
Title: Added '_' placeholder support to partial

re-opening of #1276

This implementation is a bit more complex than the one found in the other PR or underscore.contrib, but it allows for being able to include more parameters in the method returned by _.partial than the amount of parameters to _.partial. Which is good for functions that take variable length arguments.

for example:

```javascript
var concat = function() {return _.foldl(arguments, function(a,b){return a+b;})}
var concat_xbnx = _.partial(concat, _, 'b');
concat_xbnx('a','c','d'); //"abcd";
```

It also allows for continues application until all the placeholders are filled (haskell style)

```javascript
var add = function() {return _.foldl(arguments, function(a,b){return a+b;})};
var add3orMore = _.partial(add, _, _, _);
add3orMore(1)(2)(3,4,5); //15
```