Treat this page as a map. Each card answers “what shape am I looking at?” and links to the page explaining its exact behavior. You do not need to memorize the cards before starting the course.
Literals and comments
value ; commentNumbers, booleans, strings, characters, and quoted symbols evaluate to predictable values. A semicolon starts a line comment.
(list 42 #t "tea" #\T 'ready)
; the comment is ignoredCalls and nesting
(procedure argument ...)The first expression selects a procedure. Operator and arguments are evaluated from left to right. A nested call finishes before the outer form uses its value.
(+ 10 (* 2 3))Names and local bindings
define · let · let* · letrecChoose define for a top-level name, let for parallel local inputs, let*
when a later binding needs an earlier one, and letrec for recursive local
names.
(let ((price 20) (fee 3))
(+ price fee))Named procedures and lambda
(define (name x) body) · (lambda (x) body)A procedure is a value. Give it a top-level name with definition shorthand or
create it inline with lambda.
(define (double n) (* n 2))
(double 6)Conditions
if · cond · case · and · orif chooses between two expressions. cond names several tests. and and
or stop as soon as the result is known. Only #f is false.
(if (>= 62 50) 'free 'standard)Quoted data and lists
'datum · (list value ...)A quote preserves a form as data. The list procedure evaluates its inputs and
constructs a new proper list.
(list 'decision 'allow)Strings, vectors, and bytes
"text" · #(value ...) · #u8(byte ...)Strings hold Unicode text. Vectors store ordered elements you reach by index and
are mutable in the current profile. Bytevectors hold bytes from 0 through 255
and remain immutable. Below, string-length counts the characters in a string
and vector-ref takes one element out by a zero based index.
(list (string-length "Lispex")
(vector-ref #(red green blue) 1))Recursion and higher-order work
recur · map · filter · fold · applyDecompose data structures with a shrinking recursive call, or pass a procedure
to map, filter, and folds. Proper tail calls support loop-shaped recursion.
(map (lambda (n) (* n 10)) '(1 2 3))Advanced next
| Question | Continue with |
|---|---|
| How can closures share a changing binding? | Bindings, Cells, and Mutation and Closures |
Why does 1/3 stay exact while (/ 1.0 3) is inexact? | Exact and Inexact Numbers |
| How can one computation return two results? | Multiple Values |
| Which recursive calls use constant stack? | Proper Tail Calls |
| When is an escape continuation appropriate? | Continuations and dynamic-wind |
| How are infinite work and huge output stopped? | Determinism and Resources |
Consult Reader Grammar and Core Forms for exact accepted tokens and form shapes. Revisit the Learning Path when you want a guided sequence.