3 ms·
> We are using clojure for the code snippets - as it belongs to the LISP family, and LISP is founded on top of lambda calculus. The lambda calculus doesn't hav
by catnaroek 10y ago
> We are using clojure for the code snippets - as it belongs to the LISP family, and LISP is founded on top of lambda calculus.
The lambda calculus doesn't have functions of more than one argument, which is itself a variable standing for a lambda term (satisfying additional restrictions, depending on your choice of reduction strategy). If you want functions of more arguments, you need to curry them. If you want arguments to have arbitrary structure, you need to Church-encode them.
The lambda calculus doesn't have macros or any other means to analyze its own syntax. The only thing you can do with a lambda abstraction is apply it. That's precisely why it's called lambda abstraction: you don't get to peek into its internals. Which is why it's a theorem, and not a triviality, that the lambda calculus is as expressive as Turing machines. (As long as you only care about computability, that is.)
The lambda calculus doesn't have pretty-printing. If you want it, it has to be an external facility (say, of the REPL), not a first-class operation internal to the system. Warning: pretty-printing lambda terms can cause psychological trauma.
For obvious reasons, nobody uses the lambda calculus as a serious programming language. But there are several actual implementations floating around the Interwebs. And, if you don't want to use those, implementing the lambda calculus on your own isn't even hard. So, if your goal is to teach the lambda calculus, why not actually implement and actually use the lambda calculus?