[][返回 /random/][首頁]0 回覆48 瀏覽

Let's ALL LOVE LAIN/LISP!!!

分區:/random/ · 樓主:nil

(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游戏

[登入] 後參與回覆、點讚與收藏