CSC151 2007S, Class 09: Computing with Symbols and Numbers Admin: * Are there questions on Assignment 3? * Advance notice: Extra credit for attending Thursday's convo. * There is only one readings for tomorrow, Representing Images as Lists of Spots * The Mac version of DrFu is now available, but experimental. Send comments! * Upcoming work * Another quiz on Friday (and almost every Friday) * Exam 1 distributed Friday * Once again, I'll be running Dr. Davis's class today. * When should Max's office hours Monday 8-9 Overview: * Types. * Kinds of Numbers. * Key Numeric Operations. * Lab. ==Types in Scheme (and other languages)== * Programs deal with different kinds of values * Numbers (3.14), Strings ("DrFu", "Red"), turtles, drawings, ... * Why have different kinds of valeus? * Because we think about them differently. * Because the computer may represent them differently. * Because we want to make sure that operations make sense * It doesn't make sense to divide a procedure by 4 * It doesn't make sense to move the number 4 forward 3 pixels * Different languages approach types differently * Scheme "I'll figure it out from context" * Most languages "You have to tell me!" * Easier to catch errors * But tedious ==Symbols== * In Scheme and LISP, but not a lot of other languages * Looks like a string, but without quotation marks "red" string red symbol * Both strings and symbols name things * symbols are atomic: YOu think of them as a whole thing * strings are compound: You break them up into letters * We tend to use symbols for efficiency * Strings take some extra computational power to compare * Symbols don't * Somewhat boring: Create and compare, but not much else ==Numbers== * Lots of subtypes