Skip to content

Instantly share code, notes, and snippets.

@augustl
Created December 28, 2015 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save augustl/7701d965c6e2f7484d69 to your computer and use it in GitHub Desktop.
Save augustl/7701d965c6e2f7484d69 to your computer and use it in GitHub Desktop.
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