CSC151.01 2006F, Class 04: Beginning Scheme Admin: * Homework: Read "Symbolic Values in Scheme" and "Lists in Scheme" * Today will mix lecture, lab, and a bit of discussion. * A note on homework 2: CITE YOUR PARTNER. * When you don't finish a lab in class, please come back in the evening to complete it. * When you finish early, work on the extra problems. * Speed on labs does not predict success in course. * Second-year students: Don't forget the "Sophomore" events tomorrow. Overview: * Why use programming languages? * Scheme basics. * Scheme history. * Lab. * Reflect /About Programming Languages/ * We do algorithms * We express them in a formal language (aka "programming language") * Why? * English can be ambiguous * Times flies like an arrow * Fruit flies like a banana * Therefore we need something unambiguous * To express things to the computer * To express things to each other * In this class, we use Scheme * Two rules for writing Scheme "sentences" (aka "expressions", "programs") * Parenthesize (almost) everything * Prefix: Put operations first * Perfection: If the smallest thing is incorrect, everything is wrong. Ha ha! /Where Does Scheme Come From (and Do We Care?)/ * Scheme evolved from LISP * Developed in the late 1950's at MIT to do AI research * Belief "knowledge is symbolic" "knowledge represented as collections" * Evidence that some success of LISP by accident * But survives today /Reflective Questions and Comments/ * Why do you verify that an answer is correct? What if I'm so untrustworthy that I've given you software that intentionally gives incorrect answers. What if Noyce's death led to a lack of quality control at Intel, so that some of the chips in these computers are flawed? * And yes, the latter is true. * This will be a question we ask you regularly. * How did you verify that the difference was correct? * Why are the default behaviors for zero-parameter + and * different? * Why are the default behaviors for one-parameters + and - different? * Why are the default behaviors for one-parameters * and / different? * Observation: The thing immediately after the parens is treated as a procedure. Hence, Scheme hates (4) (-5) (dozen) * Strive for readability