Recently I had to port a small bit of ClojureScript code to Wisp and the following shims helped me. Would be good to get these into Wisp itself.
function count(x) { return x.length; }
function mapIndexed(f, a) { return a.map(function(l, i) { return f(i,l);}); }
function partial(fn) {
var slice = Array.prototype.slice;
var stored_args = slice.call(arguments, 1);
return function () {
var new_args = slice.call(arguments);
var args = stored_args.concat(new_args);
return fn.apply(null, args);
};
}
The following should be done better and/or implemented properly:
function doall(x) { return x; }
function isEqual(a, b) { return a == b; }