Last active
August 2, 2018 14:58
-
-
Save b0oh/4466630e44c648adf466388c7e57d2dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (let* ((identity (lambda (same) same)) | |
| (const (lambda (always _any) always)) | |
| (true const) | |
| (false (const identity)) | |
| (pair (lambda (first second pair) (pair first second))) | |
| (first (lambda (pair) (pair true))) | |
| (second (lambda (pair) (pair false))) | |
| (0 (lambda (succ zero) zero)) | |
| (+1 (lambda (num succ zero) (succ (num succ zero)))) | |
| (+ (lambda (num1 num2 succ zero) (num1 succ (num2 succ zero)))) | |
| (* (lambda (num1 num2 succ zero) (num1 (num2 succ) zero))) | |
| (paired+1 (lambda (num) (pair (second num) (+1 (second num))))) | |
| (-1 (lambda (num) (first (num paired+1 (pair 0 0))))) | |
| (1 (+1 0)) | |
| (2 (+ 1 1)) | |
| (4 (* 2 2)) | |
| (16 (* 4 4))) | |
| (-1 16)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment