CSC151.02 2003F, Class 6: An Introduction to Scheme Admin * Questions on homework 1. Does anyone need a partner? * Any general questions or concerns about the class so far? * Reading: Symbolic values in Scheme. * Reading: Lists in Scheme. * Festival of the Arts and opening of Roots of Renewal this weekend. Extra credit for attending! * Two weeks to "Talk Like a Pirate" day. I may make the focus of that class (and the previous day) a Web service to generate pirate-speak. Email me objections or suggestions. * Everyone should get a Plan. Email accounts@grinnellplans.com and say Sam sent you. Topics: * Telling Scheme to do things. * Some key Scheme operations. * A short history of Scheme. * DrScheme lab. * Scheme lab. * Reflection (if there is time). History and Background * More than forty years ago, "folks" (mostly Psychologists) said "Thought is algorithmic, computer can run algorithms, hence we can simulate intelligence". * Most computer languages focused on numeric processing. * Thought is more symbolic. * John McCarthy (scholar at MIT) wrote a language to support this community. He called it "LISP". "LIst and Symbolic Processing language". * Incredily simple syntax: Generally easy to use * Included this funky "lambda" thing, which he later reported he didn't really understand. * Amazingly enough, forty years later, people still program in LISP. * However, LISP has some significant problems, so there are dozens of variants. * About twenty years ago, a few folks at MIT decided to re-design LISP for education. The result is "Scheme". * Scheme is a pretty nice teaching langauge: * Easy to learn (very little syntax) * Symbolic processing is fun * Built-in lists are convenient * Lambdas let us consider some very complex ideas The basics of Scheme: * Every operation in Scheme is written in more-or-less the same way. * open paren * operation * arguments, separated by spaces * close paren * (sqrt 5) * (+ 2 3) Key Scheme operations: * sqrt * +, -, *, / * expt You now know enough Scheme to start today's labs. Any questions? ---- Reflection: Observations about the laboratory manual(s): * The DrScheme introduction is cleverly written to show two different mechansisms for giving instructions. * The DrScheme introduction is often written "robustly"; it predicts errors and tries to recover from them. Questions: * What's the difference between the top and bottom panes? * How would you know that the answer to (sqrt 843256) was correct? * How do you write "multiply three by seven and then add 5"? (+ (* 3 7) 5)