Scheme Koans
Scheme is a Lisp reduced to its essentials: a few forms, lists to hold both data and code, and functions as values. Its small size has made it the language of classic computer science books and courses, and a laboratory for ideas such as tail calls, continuations and hygienic macros. These koans follow R7RS, its current standard: lists and pairs, recursion, higher-order functions, closures, records, continuations and macros.
74 koans in 19 groups, tested with SRFI 64. Each is a small program whose tests fail: replace every ___ until they pass.
Awakening
How a koan checks your answers, and what Scheme counts as true.
Numbers
Arithmetic on whole numbers, and the functions that work on them.
Pairs and lists
The pair, Scheme's building block, and the lists made from pairs.
Strings and characters
Text, the characters it's made of, and symbols.
Vectors
Fixed-size collections, indexed in constant time.
Definitions
Naming values and procedures, and the forms that bind names.
Control flow
Choosing what to do: if, cond, case, and loops.
Recursion
Procedures that call themselves, and loops that are really recursion.
Trees
Lists inside lists: recursion in two directions.
Higher-order procedures
Procedures that take or return procedures.
Closures and state
Procedures that keep their surroundings, and values that change.
Association lists
Lists of pairs used as small tables.
Records
Defining your own types with define-record-type.
Laziness
Delaying a computation until its value is needed.
Continuations
call/cc: the rest of the computation, as a procedure.
Errors
Raising errors and handling them.
Macros
Code is data: quasiquote, and macros that rewrite code.
Ports
Reading and writing text through string ports.
Puzzles
Small programs to read and predict.