Red Tape
(Read Your Copy)
- Fill out the schedule cards
- Lectures, recitations, tutorials, and lab
- C / C++ section
- Collaboration policy
- Course secretary
- Feb. 20 Optional Lecture on Debugging
- Quiz dates: Wed. Mar 20, Tues. Apr. 23
Course Overview
- How-to (procedural or imperative) Knowledge
- Vocabulary
- Language = Primitives + Combinations + Abstractions
- Measurement and Control of Resources
- Large-scale System Structure
- Making Problem Solving Languages
Scheme Expressions
Expressions are evaluated to yield
a value.
Every value has a type:
Number, Boolean, Procedure, String
later: Symbol, Pair, Vector, Promise (stream)
Simple Expressions (Blackboard)
numerals: 3 -4 5.3 3.5e3 3/4 3+4i
pre-defined procedures: + - * / min max
define "expression": (define x 3)
combinations: (+ 3 x)
making new procedures: (lambda (x) (+ x 3))
putting it together:
(define add-4 (lambda (y) (+ y 4)))
(add-4 10)
((lambda (y) (+ y 4)) 10)
Primitive Expressions (no parens)
- Constants
- numerals, quoted strings, booleans #t and #f,
...
- Variables
- names for values
Compound Expressions (in parens)
- Special forms
- and, begin, case, cond, define, do, if,
lambda, let, let*, letrec, or, quasiquote, quote,
set!
- Combinations
- "Function call" or "procedure application"
Jim Miller's 6.001 Mantras -- Part 1
- Every expression* has a value.
- To find the value of a combination,
- Find the values of all of the subexpressions, in any order
- Apply the value of the first to the values of the rest
- The value of a lambda expression is a procedure.
*: Except for errors, infinite loops, and the define special
form.