Please read this entire email. In it you'll see several important announcements as well as answers/clarifications to some of the questions people had in tutorial. ROOM CHANGE: All of my Tuesday students should note that the location has changed. We will be meeting in 32-044A. Monday students will continue to meet in 32-044F. These rooms are in the basement of Stata. If you've started working on Project 1, please recheck the website. Some fixes to the differential equation were made last night (9 Feb). Both the project description and basebot.scm were modified. Substitute: Next week, Marshall Tappen will be substituting for me for the M11, M1, M2, and M3 tutorial sessions. He TAed the course last semester and will be using the same handout as the other sessions. Graded project 0 is available for everyone who has not yet picked theirs up. Listeners: you are invited to attend tutorials, but your assignments will not be graded (unless I forget and do it anyway) Many of you are in one of Horn's recitation sections. Prof. Horn has made his recitation notes available online at http://csail.mit.edu/~bkph/courses/6001/. Q: What’s the difference between a functional and a procedural language? A: http://en.wikipedia.org/wiki/Functional_programming Cond evaluates the body associated with the first true test condition, e.g. (cond ((> 1 0) 1) ((> 2 0) 2) (else 3)) ; -> 1 Q: Is "else" a special form? A: "else" is a keyword in the "cond" special form, not a special form itself (http://sicp.csail.mit.edu/Spring-2005/manuals/scheme-7.5.5/doc/scheme_2.html#SEC27). I did not count off on project 0 for calling "else" a special form (even though it’s not). Several different implementations for remainder were implemented in tutorials. I wanted to send out a compact exact solution so that everyone can see it. Note that the precise definition of what the built-in version of this procedure accomplishes can be found in the MIT Scheme Reference Manual (ftp://ftp.gnu.org/gnu/mit-scheme/stable.pkg/7.7.1/). ; Finds the remainder of the integer division of x / y ; Limitations: ; x must be non-negative ; y must be a strictly positive integer (define remainder (lambda (x y) (if (< x y) x (remainder (- x y) y)))) ;; Tests (remainder 3 7) ; -> 3 ;Value: 3 (remainder 13 7) ; -> 6 ;Value: 6 (remainder 0 7) ; -> 0 ;Value: 0 (remainder 7 7) ; -> 0 ;Value: 0 Note that a more complex implementation could do things like handle the negative cases properly and signal an error (or return #f) when the denominator is zero, etc. --Gerald Dalley dalleyg@mit.edu