(define-syntax λ
(syntax-rules ()
[(λ x body ...)
(lambda (x) body ...)]))
(define-syntax λxy
(syntax-rules ()
[(λxy x y body ...)
(lambda (x)
(lambda (y) body ...))]))
;;;Church Encodings
(define TRUE
(λxy x y x))
(define FALSE
(λxy x y y))
(define IF
(λxy b t
(λ e ((b t) e))))
(define AND
(λxy left right
((((left right) FALSE) left) FALSE)))
(define OR
(λxy left right
(((IF left) TRUE)(((IF right)TRUE)FALSE))))
(define not
(λ x
(((IF x) FALSE) TRUE)))
Lain,RMS,john mccarthy力荐
不会写Lisp/SICP的黑客不是一个好黑客!
详见:
https://lain.wiki/wiki/Knights_of_the_Eastern_Calculus
https://plato.stanford.edu/entries/lambda-calculus/
https://en.wikipedia.org/wiki/Knights_of_the_Lambda_Calculus
https://web.mit.edu/6.001/6.037/sicp.pdf
https://www.lisp.org/
PS1 Lain游戏
