Category:SICP solutions

From Drewiki
Jump to: navigation, search

Solutions for exercises in Structure and Interpretation of Computer Programs.

With the exception of exercises 2.44, 2.45 and 2.49, solutions that provide Scheme interpreter output and/or timings were run using Chicken Scheme v2.6 or v3.1 on an 2.4GHz Apple MacBook Pro 17" running OS X 10.5 and/or Debian GNU/Linux. The solutions for exercises 2.44, 2.45 and 2.49 were produced using PLT Scheme v4.1.3 on the same hardware and operating system. Your output may vary.

Contents

Obtaining the code

A git repository for all of the code is here. Note that the git repo only contains code; the explanations are only available here on the wiki.

Scheme dialects

The Scheme dialect used by SICP is MIT Scheme, which includes primitives that aren't available on other Scheme dialects. The following MIT Scheme primitives are not available in Chicken Scheme. When using an SICP exercise solution from this wiki with Chicken Scheme (and, possibly, with other Scheme dialects not compatible with MIT Scheme), make sure the following symbols are defined.

nil

(define nil (quote ()))

true and false

(define true #t)
(define false #f)

Running the code

Some of the solutions provide implementations of procedures whose names are the same as Scheme primitives. Many of these implementations are incompatible with and/or less efficient than the primitives they shadow. If you choose to run any of the code given in these solutions, you should run it in a new instance of your Scheme environment unless the solution is part of a sequence of exercises that build on each other.

If a particular solution requires definitions provided by a previous solution, that solution should provide or reference the previous definitions.

License

All of the SICP solutions posted on this wiki are Copyright 2008 Drew Hess and are licensed under the GNU GPL version 3.

External links

HTML version of SICP.

PDF version.

TeXinfo version (great for Emacs).

Video lectures by Abelson and Sussman, given in July 1986 for Hewlett-Packard employees.

SICP wiki, (as-yet-incomplete) solutions to SICP exercises in various languages.

Eli Bendersky's SICP reading notes, including solutions to most (all?) exercises.

Pages in category "SICP solutions"

The following 114 pages are in this category, out of 114 total.

S

S cont.

S cont.

Personal tools