From 58b1fb955b3b242e0c8ac9a0c5c092cbee5d5fbf Mon Sep 17 00:00:00 2001 From: barker Date: Mon, 13 Sep 2010 09:47:33 -0400 Subject: [PATCH] --- assignment1.mdwn | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/assignment1.mdwn b/assignment1.mdwn index cc535c2b..12cd7059 100644 --- a/assignment1.mdwn +++ b/assignment1.mdwn @@ -26,8 +26,7 @@ In Racket, these can be defined like this: (define true (lambda (t) (lambda (f) t))) (define false (lambda (t) (lambda (f) f))) - 8. Define a "neg" operator that negates "true" and "false". - +* Define a "neg" operator that negates "true" and "false". Expected behavior: (((neg true) 10) 20) @@ -38,10 +37,9 @@ evaluates to 20, and evaluates to 10. - 9. Define an "and" operator. - - 10. Define an "xor" operator. +* Define an "and" operator. +* Define an "xor" operator. (If you haven't seen this term before, here's a truth table: true xor true = false @@ -51,9 +49,8 @@ evaluates to 10. ) - 11. Inspired by our definition of boolean values, propose a data structure - capable of representing one of the two values "black" or "white". - +* Inspired by our definition of boolean values, propose a data structure +capable of representing one of the two values "black" or "white". If we have one of those values, call it a black-or-white-value, we should be able to write: @@ -65,7 +62,7 @@ if-white, depending on which of the black-or-white values we started with. Give a definition for each of "black" and "white". (Do it in both lambda calculus and also in Racket.) -12. Now propose a data structure capable of representing one of the three values +* Now propose a data structure capable of representing one of the three values "red" "green" or "blue," based on the same model. (Do it in both lambda calculus and also in Racket.) -- 2.11.0