Red Tape

(Read Your Copy)

Course Overview

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

  1. Every expression* has a value.
  2. To find the value of a combination,
  3. The value of a lambda expression is a procedure.

*: Except for errors, infinite loops, and the define special form.