Skip to content

Instantly share code, notes, and snippets.

View agentcooper's full-sized avatar

Artem Tyurin agentcooper

  • Amsterdam, Netherlands
View GitHub Profile
@agentcooper
agentcooper / index.js
Last active November 17, 2015 10:48
sicp.js
// node --harmony index.js
var cons = (a, b) => (f) => f(a, b);
var car = (p) => p((p, q) => p);
var cdr = (p) => p((p, q) => q);
var list = (first, ...rest) =>
!first ?
var _ = [];
var letters = "abcdefghijklmnopqrstuvwxyz".split('');
letters.forEach(function(letter) {
function f() {
var out = _.join('');
_.length = 0;
return out;
}