Placing the Underscore project into the Global Namespace.
Coughy is quite wrong in that it places the Underscore library into the global name space. /WHAT!?/ Yes. Just look at this beautiful code:
reduce( map( range(5), (x) -> x * x ), (total, cur) -> total + cur )
Why do this? This certainly isn't for everyone, or every project, but for working on [[http://projecteuler.net/][Project Euler]], or teaching programming concepts, this seems like an acceptable solution.
As usual, you can take advantage of this project by adding this to your normal Node-related project:
npm install coughy
Now, you can create scripts that use those functions directly:
Note: You do not need to assign the results of the coughy module *because , it is already placed in the global namespace.
** REPL Sweetness
By using the [[http://danielgtaylor.github.io/nesh/][Nesh project]], we can make pre-load /coughy/ in order to make a better REPL:
npm install -g nesh
Then, create a Shell function like this:
nesh --lang coffee --eval 'node_modules/coughy/coughy.js'
Where =coughy.js= needs to be the filename to the magic script that provides this pleasing abomination.
Think of this... An even more functional approach to development is with something like the immutable data structures available from [[http://swannodette.github.io/mori/][Mori]] ... However, since Mori's functions overlap with Underscore (but seem to be more general), I may just swap it.