The Little Schemer
F o u r t h E d i t i o n
Daniel P. Friedman and Matthias Felleisen
Foreword bf GenW J. s-.n.a
The Ten Commandments
The First Commandment
When recurring on a list of atoms, lat, ask
two questions about it: (null? lat) and else.
When recurring on a number, n, ask two
questions about it: (zero? n) and else.
When recurring on a list of S-expressions, l,
ask three question about it: (null? l), (atom?
(car l)), and else.
The Second Commandment
Use cons to build lists.
The Third Commandment
The Fifth Commandment
When building a value with + ,always use
0 for the value of the terminating line, for
adding 0 does not change the value of an
addition.
When building a value with x, always use
1 for the value of the terminating line, for
multiplying by 1 does not change the value
of a multiplication.
When building a value with cons, always
consider () for the value of the terminating
line.
When building a list, describe the
Command/ing/build/ment/terminating/recurring/question/else./change/alway/
Command/ing/build/ment/terminating/recurring/question/else./change/alway/
-->