Skip to content

Instantly share code, notes, and snippets.

@augustl augustl/mori-test.js
Created Dec 28, 2015

Embed
What would you like to do?
function log() {
console.log(mori.hash(xs), mori.count(xs), mori.toJs(xs));
}
var xs = mori.vector(1, 2);
log(); // 1185709346 2 Array [ 1, 2 ]
xs = mori.remove(function (x) { return x === 2 }, xs);
log(); // -1939225835 1 Array [ 1 ]
xs = mori.conj(xs, 3);
log(); // -1144666071 2 Array [ 3, 1 ]
xs = mori.conj(xs, "abc");
log(); // -1144666071 3 Array [ "abc", 3, 1 ]
xs = mori.remove(function (x) { return x === "abc" }, xs);
log(); // -1144666071 2 Array [ 3, 1 ]
xs = mori.conj(xs, 4);
log(); // 910705533 3 Array [ 4, 3, 1 ]
xs = mori.conj(xs, 5);
log(); // 910705533 4 Array [ 5, 4, 3, 1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.