CSC151 2007S, Class 27: Preconditions, Revisited * I will continue to reserve time at the start of class for topics you would like to discuss. Admin: * Quiz 5 returned. High scores count. Low scores do not. * Are there questions on Exam 2? (Q&A appear below.) * EC for Saturday's concert, the weekend play, and Mary B James. Russian house's International Women's day celebration on Sat. at 2pm 1217 Park St. Flute studio hosts amazing musical duo (and lots of other stuff) on Saturday in Bucksbaum * Assignment 7 (due after break) is now available. It does, however, require the next few readings/labs. * I've added a link to the A-Z reference to every page. * Monday's reading: Local Procedure Bindings. (Not yet available.) Overview: * Verifying preconditions. * Reporting errors with throw. * Husk and Kernel programming. * Quiz. * Lab. == Quiz 5 === Question one: Here is a color modifiying procedure. Modify an image * (image-variant portrait (compose rgb-lighter rgb-average-with-brown)) Question two: Compare two implementation (define rawb-1 (let ((brown ..)) (lambda (...) vs (define rawb-2 (lambda (...) (let ((brown ...)) ...))) == Exam Q&A == Q: Can you give me a hint about the structure for problem 3? A: Sure (image-compute-pixels! canvas 0 0 (- (image-width canvas) 1) (- (image-height canvas) 1) (lambda (pos) (cond ... (else color-transparent)))) Q: Does the order of parmaeters to rgb-distance matter? A: No (see analysis on real whiteboard0 Q: Does the order of the estimates to rgb-closest-estimate-of-2 matter? A: Probably. Consider (closest-estimate-of-2 color est1 est2) Suppose est1 and est2 are the same distance from color. Which should you return? * It doesn't matter, so you can return either * Most people say "the first"