From: barker Date: Mon, 13 Sep 2010 13:40:08 +0000 (-0400) Subject: (no commit message) X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=7e98785584b3e6bef8f331c032e2b41b0c92deea --- diff --git a/assignment1.mdwn b/assignment1.mdwn index 9be95780..dd1fa12c 100644 --- a/assignment1.mdwn +++ b/assignment1.mdwn @@ -24,21 +24,29 @@ 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". -Expected behavior: (((neg true) 10) 20) evaluates to 20, -(((neg false) 10) 20) evaluates to 10. +* 8. Define a "neg" operator that negates "true" and "false". +Expected behavior: -(9). Define an "and" operator. + (((neg true) 10) 20) -10. Define an "xor" operator. (If you haven't seen this term before, here's a truth table: +evaluates to 20, and + + (((neg false) 10) 20) + +evaluates to 10. + +* 9. Define an "and" operator. + +* 10. Define an "xor" operator. (If you haven't seen this term before, here's a truth table: true xor true = false true xor false = true false xor true = true false xor false = false + ) -11. Inspired by our definition of boolean values, propose a data structure +* 11. 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: