Hacker News new | past | comments | ask | show | jobs | submit login

Here's what I use:

  # Adapted from http://autotelicum.github.com/Smooth-CoffeeScript/literate/partial.html
  F.partial = (func, a...) -> (b...) ->
    func (for arg in a then arg ?= b.shift())..., b...
For example, do `parseInt10 = F.partial(parseInt, undefined, 10)`, then `[].map(parseInt10)` does the right thing.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: