CSC151 2007S, Class 03: An Introduction to Scheme Admin: * Assignment 2 is ready and was distributed late on Saturday. + Originally due 10:00 a.m. Tuesday. + Free extension until 10:00 a.m. Wednesday. + Questions? + Circles are prefereable to squares, but squares will be accepted * Tonight, as is the case nearly every night, there is a reading. + This reading is on raster graphics. + It is fairly short + The links do not necessarily work * I regularly offer extra credit for academic activities and activities in which you support classmates. + Thursday at 11:00: Osgood's convo + Thursday at 4:15: Robert Richards from UofC + Thursday at 4:30: John David Stone on really big numbers + Home cross-country meet Saturday (the only one this semester) + Shuttles run from ... * Working outside these rooms + We'll have some instructions in about a week Overview: * Why use programming languages? * Scheme basics. * Scheme history. * Lab! /What is Computer Science?/ * The study of algorithms and data * We need to express the algorithms so that the computer can understand them * Maybe English? (French, Esperanto) * English, in particular, is confusing * Grammar and syntax are complicated * English tends to be ambiguous * In order to teach the computer to understand, we'll have to teach it the language, so we want a simple language * We want to avoid ambiguity, and most "natural" languages are ambiguous * Time flies like an arrow * Fruit flies like a banana * In response, Computer Scientists design their own languages * Lots and lots * Each with advantages and disadvantages /Scheme - The Language we use in this course/ * Very simple syntax and model of computation * Most computing takes the form of * apply functions to argumentsa * define our own functions * To apply functions to arguments open paren name of the function (or just the function) the arguments to the function, separated by spaces close paren (+ 3 4) ; "Add three and four" (sqrt 10) (max grade1 grade2 grade3 grade4)a * Warning! Terminology * function = procedure = operation * argument = parameter = actual /History/ * Scheme is "old" - Based on Lisp, invented in 1958 * Scheme is a better version of Lisp * Resolves problems * Designed for teaching /Reflection/ * Okay, quitting and restarting is a *bad* idea. We'll work on it! * How did you know that the square root answer was correct? * My calculator says so * The computer says so when I try to square * I did it by hand