Oliver Steele lives in Western Massachusetts and commutes to downtown LA, where he is bringing an operating system from handwaving to reality. He was the architect of OpenLaszlo, the author of PyWordNet and other open source projects. His interests include programming languages, knowledge representation, information visualization, and math education. [more]
I'm having great fun pouring over your library. It is very well written and I'm learning a lot about functional programming from reading the source.
Regarding speed, you can improve performance by giving up your favourite idiom:
var args = [].slice.call(arguments, 0);
This is expensive because it creates a new Array object every time you slice an arguments object. Which is very often.
Mozilla provides a static slice method on the Array object. Or you can fake it yourself:
if (!Array.slice) { // Mozilla already supports this
Array.slice = function(array) {
// Slice an array-like object.
var slice = Array.prototype.slice;
return slice.apply(array, slice.call(arguments, 1));
};
}
And use it like this:
var args0 = Array.slice(arguments); // cast to Array
var args1 = Array.slice(arguments, 1); // a normal slice
I use it so often I make it global.
var slice = Array.slice;
var args = slice(arguments);
Hope that helps. Back to reading your source code for me. :)