Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created August 22, 2015 19:27
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 tenderlove/b324692192139d97d43e to your computer and use it in GitHub Desktop.
Save tenderlove/b324692192139d97d43e to your computer and use it in GitHub Desktop.
type Null
end
nil = Null()
cons = function(x, y)
(m) -> m(x, y)
end
car = function(z)
z((p, q)->p)
end
cdr = function(z)
z((p, q)->q)
end
function each(m, l)
val = car(l)
m(val)
if cdr(l) != nil
each(m, cdr(l))
end
end
list = cons("foo", cons("bar", cons(1, nil)))
each(println, list)
@rberger
Copy link

rberger commented Aug 22, 2015

Where are your Father's Parenthesis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment