CSC151 2007S, Class 35: Naming Local Procedures Admin: * EC: This Thursday's talk on scripting video. * Snacks at 4:15 in the CS Commons * Talk at 4:30 in 3821 * Are there questions on the exam? * Reading for tomorrow: Characters and Strings. Overview: * Why have local procedures. * Creating local procedures. =Exam Questions= Q: Why are you adding something to the cdr of a list? I thought you could't add lists. (+ (cdr p) (- 1 x)) A: It's a subtlety of Scheme that we've only covered implicitly. There's now an alternative version available. Q: Why doesn't my code work? A: Most typical reason: Difficulty getting the format of cond right. (cond (TEST CONSEQUENT) (TEST CONSEQUENT)) We've been using cond rather than if to sequence operations (cond ((should-we-continue? some-info)a (update-the-drawing!) (recurse!))) Q: Doesn't cond need an else? A: It's good to have an else, but it's not required. =Lab Observations= You may find the following procedure useful (define all-rgb? (lambda (lst) (or (null? lst) (and (rgb? (car lst)) (all-rgb? (cdr lst))))))