Created
January 27, 2012 04:59
-
-
Save jamiltron/1687081 to your computer and use it in GitHub Desktop.
Exercise 5.2.1 from TAPL in Racket
This file contains 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
#lang racket | |
;; tru = \t. \f. t | |
(define tru | |
(lambda [t] | |
(lambda [f] t))) | |
;; fls = \t. \f. f | |
(define fls | |
(lambda [t] | |
(lambda [f] f))) | |
;; l-and = \b. \c. b c fls | |
(define l-and | |
(lambda [b] | |
(lambda [c] | |
((b c) fls)))) | |
;; l-or = \b. \c. b tru c | |
(define l-or | |
(lambda [b] | |
(lambda [c] | |
((b tru) c)))) | |
;; l-not = \b. b fls tru | |
(define l-not | |
(lambda [b] | |
((b fls) tru))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment