Using Concrete Abstractions with MIT-Scheme

This web page provides information regarding the use of the MIT-Scheme implementation of Scheme with Concrete Abstractions: An Introduction to Computer Science Using Scheme, by Max Hailperin, Barbara Kaiser, and Karl Knight.

The information here currently corresponds with versions 7.3 through 7.7 of MIT-Scheme; we will try to track new versions of MIT-Scheme as they come out.

Obtaining MIT-Scheme

MIT-Scheme is an implementation of Scheme that is made freely available by MIT. It includes a text-editing user interface, similar to GNU emacs, that is known as edwin. (If you don't know what "similar to GNU emacs" means, it means that the interface is likely to be appreciated by experienced hackers, but be something of a hurdle for new users.) MIT-Scheme can be obtained from the web. Versions are available for Windows, OS/2, and various versions of Linux and Unix with X Windows. So far we have only tested MIT-Scheme with the software for our book under Linux and Windows NT. We know that our graphics examples won't work under OS/2. Other than that, we don't know of any reason why our book wouldn't work equally well with MIT-Scheme on other systems. We'd like to hear of any problems you encounter.

Libraries for use with MIT Scheme

There are two areas of the textbook for which a special library needs to be loaded into MIT Scheme. One is the graphical images, introduced in the application section of chapter 1 and also used in subsequent chapters. The other is the object-oriented programming system, used in chapter 14.

Each of these libraries can be downloaded from the web below. Once you have one of the library files on your system, you can load it into MIT Scheme using the load procedure. For example, you could evaluate (load "fungraph") to load in the fungraph library. If the fungraph.scm file isn't in your current directory (folder) you might need to specify a pathname, such as (load "/usr/local/scheme-libraries/fungraph") or (load "c:\\scheme\\libraries\\fungraph").

This is the library for graphical images. In addition to the features described in the textbook (most succinctly in the appendix), there are a few extensions. Descriptions of those extensions and a couple hints regarding usage are in a separate web page.
This is the object-oriented programming system for use with chapter 14.

General notes

Names defined in both Concrete Abstractions and MIT-Scheme

There are a number of names that we define in Concrete Abstractions that are already pre-defined in MIT-Scheme. The only real problem this causes is that if you perform the definition from the book, you can't expect the name to simultaneously have both the new value and the one described in the MIT-Scheme documentation.

We list below the affected names, organized into categories and listed within each category in their order of their appearance within the book:

Equivalence of #f and the empty list

As mentioned in the Appendix, the R4RS standard for Scheme allows Scheme implementations to have a single value play the roles of both #f (the false value) and the empty list, (). MIT-Scheme has chosen to do this. The result, as mentioned in the Appendix, is that you will see () in output wherever the book shows #f. However, you should continue to use #f in your programs.

Positioning of (newline)

Starting in chapter 6, we use the newline procedure to break output into separate lines. Unfortunately, there are two different conventions in use by different Scheme systems. One is to always use newline at the start of each line of output, while the other is to always use it at the end of each line. As a result of this lack of standardization, wherever we positioned the uses of (newline) in our programs would result in output that looked odd on some systems. We've tried in the textbook to make choices that don't look too horrible on any system, with the result that the output tends to look sub-optimal on every system. In particular, there tends to be extra blank lines. If you are working consistently within MIT-Scheme (or any other one system), feel free to remove or reposition (newline) as necessary to make the output look best.

Chapter by chapter notes

Chapter 1
The procedures for manipulating graphical images need to be loaded from a library, as described above. Additionally, it is worth noting that the various basic blocks, such as rcross-bb, are neither pre-defined nor defined within the library. Instead, their definitions are in a separate file.
Chapter 9
Several sequence procedures in section 9.2 use the name sequence for a parameter. (The procedures are head, tail, empty-sequence?, sequence-length, and sequence-ref.) Unfortunately, MIT-Scheme (up through 7.4) has chosen to preempt this name, making it a special keyword equivalent to begin. Therefore, to make these five procedure work under MIT-Scheme, you will need to rename the parameter; for example, you could use seq in place of sequence. The same consideration applies to any other procedures you write: don't use the name sequence.

The preceding applies to MIT Scheme 7.3 and 7.4. In MIT Scheme 7.5 and later, it is possible to use sequence as a parameter name in a lambda expression, as we do in section 9.2.

For the application section, we have a MIT-Scheme-specific version of the show procedure.

Chapter 11
Although you could use the SLIM simulator from the application section to work through the earlier sections of this chapter under MIT-Scheme, you'd be better off using SLIME.
Chapter 14
You will need to load a library file into MIT-Scheme to get the object-oriented programming system, as described above.
Chapter 15
MIT-Scheme cannot be used for this chapter, since this chapter doesn't use the Scheme programming language. You will need to use a Java 1.1 system instead.

For more information, see the parent web page, or contact Max Hailperin:
Mathematics and Computer Science Department
Gustavus Adolphus College
800 W. College Avenue
St. Peter, MN 56082
Revision 1.7 as of 2003/06/01 12:25:54