Menu
SICP Distilled

SICP Distilled

  • CC by-sa Licence
  • MSF Donate

Ch1 - Building Abstractions With Functions

  • Chapter 1 Distilled
  • Introduction
  • 1.1 - The Elements Of Programming
    • Expressions
    • Naming and the Environment
    • Evaluating Combinations
    • Defining New Functions
    • The Substitution Model
    • Exercises
    • Predicates
    • Conditional Expressions
    • Example: Newton’s Method
    • Functions as Black-Box Abstractions
  • 1.2 - Procedures and the Processes They Generate
    • Linear Recursion and Iteration
    • Tree Recursion
    • Orders of Growth
    • Exponentiation
    • Greatest Common Divisors
    • Example: Testing For Primality
  • 1.3 Higher Order Functions
  • Project - Blackjack

Ch2 - Building Abstractions With Data

  • Chapter 2 Distilled
  • Introduction
  • Data Abstraction
  • Everything From Nothing
  • Abstractions In Clojure
  • Clojure's Data Structures
  • Data Abstraction, Revisited
  • Escher
  • Project - Escher
  • Symbolic Data
  • Representing Sets
  • Huffman Encoding Trees
  • Zippers

Ch3 - Modularity, Objects, and State

  • Chapter 3 Distorted
  • Introduction
  • Concurrency in Clojure

Ch4 - Metalinguistic Abstraction

  • 4.1 - The Metacircular Evaluator
  • The Halting Problem
  • The Y Combinator
  • 4.2 - Lazy Evaluation
  • 4.3 - Nondeterministic Computing
  • 4.4 - Logic Programming

Chapter 1 Distilled

Outline of the Chapter

This chapter is all about pure functions of numbers, it introduces the idea of recursive and iterative procedures and talks a bit about space and time complexity of algorithms (so-called big-O notation)

It develops a model for evaluating Clojure expressions that suffices as long as we have only pure functions

Most importantly it introduces the idea of first class elements in a programming language and uses the fact that Clojure has first class functions. Higher Order Functions is one of the main ideas in the book.

What changed

SICP is very careful to always refer to procedures in programs and reserves function for mathematical functions. I took the decision (though was very conflicted) of saying functions, mathematical functions and saying pure functions if referential transparency is significant in the context.

I think terms like first class functions, higher order functions etc are in common enough use that it is better to use them. This may change and I am interested to know what you think.

What was left out

Sections 1.1 and 1.2 are fairly direct translations of the book, though if I can think of a different example to replace Newtons Method I may well do it.

Section 1.3 I found the examples a bit contrived to stay within the constraint of having not yet introduced data structures so skipped lots of the examples (the coin counting one for instance makes much more sense with a collection of coins), replacing them with few simple ones of my own.

What was added

I took the Blackjack exercise from the projects page

Other resources

If you want to really understand recursion, check out The Litte Schemer (it goes on to things that appear later in the presentation here too)