|
|
|
|
|
by gratimax
4383 days ago
|
|
If you don't already know, there is a Church encoding for singly-linked lists that is in the lambda calculus. We can already implement some of the operations you have listed with just lambdas: (defun cons (x y)
(lambda (z) (z x y)))
(defun car (l)
(l (lambda (x y) x)))
(defun cdr (l)
(l (lambda (x y) y))) It's not like a lisp with 'just lambda' would be 'absurd and unusable'. I just showed you, we can implement cons, car, and cdr with just lambdas(hooray, closure! not clojure, closure...). Although there are some design decisions that had to be made, e.g. set, list. |
|