function cons(x, y) { return function(w) { return w(x, y) }; }; function car(z) { return z(function(x, y) { return x }); }; function cdr(z) { return z(function(x, y) { return y }); }; var list = cons(1, cons(2, null)); document.writeln( car(list)); document.writeln( car(cdr(list))); document.writeln( cdr(cdr(list)));