SICP Support for DrRacket
1 Introduction
NOTE: Instead of using this old PLaneT package, you will probably want to move to the sicp package in the new Racket package system, which is maintained by Jens Axel Søgaard. I have contributed a simple #lang sicp to that package, and do not plan to work further on this PLaneT package.
This package implements support in PLT’s DrRacket for Abelson and Sussman’s Structure and Interpretation of Computer Programs (SICP) 2nd Edition textbook, for students who wish to use DrRacket’s tools for the SICP programming assignments.
Note that this package is not a project of the PLT organization, nor of the SICP authors. PLT has a related textbook, How to Design Programs (HtDP), with a different emphasis and a different pedagogic approach. A comparison of the two textbooks is beyond the scope of this document. A 2004 paper by some PLT members, “The Structure and Interpretation of the Computer Science Curriculum” [PDF], provides a PLT perspective on the differences.
The official Web page for this package is: http://www.neilvandyke.org/racket-sicp/
This package also uses Sperber and Soegaard’s Picture Language implementation by require-ing from PLaneT. (We have tentative plans to merge the two, time permitting.)
2 Installation
Installing this package consists simply of require-ing it from the Internet-based PLaneT software repository, and then restarting DrRacket. The steps in detail for how a beginner may do this through DrRacket are:
0. If you have a previous verson of this package from PLaneT installed, remove it. If the version is 1.9 or later, go to the Interactions subwindow in SICP language, and evaluate the command (uninstall-sicp). If you have an version older than 1.9 installed, use the planet show and planet remove operating system command-line commands to remove it.
1. Make sure that the computer connected to the Internet.
2. Start DrRacket.
3. Change the DrRacket Language to use #lang. Specifically, Specifically, select Language|Choose Language... to get the Choose Language dialog, then select Use the language declared in the source or (in older versions) Module, and click OK.
4. In the top Definitions subwindow, change the contents to read:
#lang planet neil/sicp
5. Click the Run toolbar button.
6. Wait for the > prompt to appear in the Interactions subwindow, which may take a few minutes, due to compiling PLT documentation. Then quit DrRacket and start it again.
3 Usage
There are two separate ways to specify use of the SICP Language in DrRacket:
Change the Language to SICP, such as by using Language|Choose Language.... This is the normal way.
When using the Module language, begin the Scheme file with the line:
#lang planet neil/sicp
This package uses the soegaard/sicp PLaneT package by Mike Sperber and Jens Axel Søgaard to implement the SICP Picture Language. Note that you should not use the require form shown in the documentation for that package – this package provides the SICP Picture Language implicitly.
4 History
Note that PLaneT package version numbers of neil/sicp are used, rather than maintaning separate version numbers.
Version 1.18 – 2016-03-12 – Added documentation note to point people to sicp package in new Racket package system. Updated to build under Racket 6.4.
Version 1.17 – 2012-06-24 – Updated installation documentation for recent DrRacket version. Updated note about seeking new maintainer.
Version 1.16 – 2011-09-30 – info.rkt changes. Documentation changes. Fix to message in uninstall-sic.
Version 1.15 – 2011-05-14 – Run now prints the values of expressions in the Definitions window (requested by Brian Sniffen).
Version 1.14 – 2011-05-02 – Changed names and URLs to reflect migration from PLT Scheme to Racket.
Version 1.13 – 2009-05-28 – Fixed SICP streams support. Changed read-square-bracket-as-paren to #t. Consolidated tests thus far into file test.ss.
Version 1.12 – 2009-05-17 – Added rogers painter, using publicity photo of Mister Rogers.
Version 1.11 – 2009-05-17 – Fixed recent bug in check-expect and check-expect-approx. Started test-ch-2.ss.
Version 1.10 – 2009-05-17 – Fixed packaging problem and documentation problem.
Version 1.9 – 2009-05-17 – Made cons-stream use immutable pairs. (Thanks to Vinay Sachdev for reporting the cons-stream problem affecting SICP sec. 3.5.1.) Added documentation about installing prior versions before installing. Added uninstall-sicp procedure. Changed info.ss to permit multiple versions to be installed simultaneously. Added sicp-small.png icon. Improved installation documentation.
Version 1.8 – 2009-05-16 – Added random procedure for SICP Exercise 1.22. Finished first pass of test-ch-1.ss.
Version 1.7 – 2009-05-15 – Added check-expect syntax, for test suites. Added inc and dec procedures for SICP sec. 1.2.1 Exercises. Added random procedure for SICP sec. 1.2.6. When using this package from a normal PLT collection, rather than from PLaneT, the language name is now SICP rather than SICP (Non-PLaneT). Added partial test suite for SICP ch. 1. Minor documentation changes.
Version 1.6 – 2009-05-05 – Installation documentation change.
Version 1.5 – 2009-05-05 – Installation documentation change.
Version 1.4 – 2009-05-05 – Changes to work correctly with PLaneT and cause fewer conflicts from mixing multiple versions in PLTCOLLECTS and PLaneT cache at once.
Version 1.3 – 2009-05-04 – PLaneT packaging corrections and addition of index entries.
Version 1.2 – 2009-05-04 – PLaneT packaging correction.
Version 1.1 – 2009-05-04 – PLaneT packaging corrections. Also switched to using PLaneT package version numbers.
Version 1.0 – 2009-05-04 – Documentation added. First public release.
No Version – 2009-04 – Initial version by Neil Van Dyke. Uses Sperber and Soegaard’s Picture Language implementation by require-ing from PLaneT. Non-public distribution.
5 Legal
Copyright (c) 2009–2011 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License (LGPL 3), or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details.