diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-04-11 00:03:50 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-04-11 00:03:50 -0400 |
commit | 5b05b64a2a658c0f7d4eb5b09fa342c7375a776e (patch) | |
tree | bad4537081da8b969084cff6880e36418f13a97d /hw06_combinators.scm |
Init
Diffstat (limited to 'hw06_combinators.scm')
-rw-r--r-- | hw06_combinators.scm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hw06_combinators.scm b/hw06_combinators.scm new file mode 100644 index 0000000..0c3fdaf --- /dev/null +++ b/hw06_combinators.scm @@ -0,0 +1,21 @@ +#lang eopl + +; Ben Burwell +; Dr. Kussmaul +; CSI-310 Programming Languages +; HW06 :: Combinators + +; A. evaluate boolean logic expression +(or F (and T (not F))) +(or F (and T T)) +(or F T) +T + +; B. compute 2+1 using Church numerals +(increment 2) + +((λ (n) (λ (f) (λ (x) (f ((n f) x))))) (λ (f) (λ (x) (f (f x))))) +( λ (f) (λ (x) (f (((λ (f) (λ (x) (f (f x)))) f) x)))) +( λ (f) (λ (x) (f ( (λ (x) (f (f x))) x)))) +( λ (f) (λ (x) (f (f (f x))))) +(λ (f) (λ (x) (f (f (f x)))))
\ No newline at end of file |