Scheme Library

This page is organized as follows:

  1. Getting Library Files
  2. Customizing for Chez Scheme (localize.scm)
  3. Getting Homework Files
  4. Working with our Test Drivers
  5. Other Ways to use the Library

Getting Library Files

Parts of the Library

The course library has three parts, all of which can be obtained in a single zip file. However, you will also need to separately download the homework files.

The first part of the library is lib342, which consists of files written in a typed dialect of Scheme, called typedscm. Typedscm is included as the second part of the library. The third part of the library is a DrScheme ``teachpack.'' The teachpack and the lib342 part both depend on typedscm, but most of the files you will be interested in are in lib342. The teachpack, which aids testing the homework, also depends on homework files being installed.

Where to Install the Library

If you are working on your own machine under DrScheme, you must put the directories for lib342 and typedscm underneath the collects directory of PLT, and the teachpack into the teachpack directory of PLT. So, if DrScheme is installed in c:\cygwin\usr\local\PLT, then you should have a directory c:\cygwin\usr\local\PLT\collects\lib342, another directory named c:\cygwin\usr\local\PLT\collects\typedscm, and at least the file drscheme-342-teachpack.scm in c:\cygwin\usr\local\PLT\teachpack.

The Zip File

The most reliable way to get all the library files is to download a .zip file. This zip file contains the lib342 and typedscm directories (except for one file described below) and the teachpack.

Be sure to unzip it to the PLT directory, which is the DrScheme installation directory. When you do the unzip, be sure to preserve the directory structure, which will make sure that you have directories under PLT named collects/lib342 and collects/typedscm, and will put the teachpack in the PLT subdirectory named teachpack.

Setting up DrScheme for Typedscm

The first time you unzip these directories, you must run the command PLT/Setup PLT.exe (on Windows, or plt/bin/setup-plt on Unix). This compiles and installs the directories and makes them available to DrScheme. If you do not do this, you will not be able to select Typedscm as a langauge in DrScheme.

Don't be alarmed if, when running Setup PLT.exe, you see an error message that looks like the following:

setup-plt: Error during Early Install for SSL Driver (c:/cygwin/usr/local/PLT/collects\openssl)

setup-plt: extension-installer: can't find needed include files and/or library; try setting the environment variable PLT_EXTENSION_LIB_PATHS

The above error seems to be normal (on Windows) and does not affect Typedscm or the course library.

If you get other errors when installing the library, and if you had previously installed an old version. Try deleting the both old library directories (PLT/collects/lib342 and PLT/collects/typedscm) first, and then reinstall and run the setup program again.

While it may not be necessary to run this setup program when reinstalling the library, it does help make DrScheme run faster.

Be sure you have also downloaded the zip file containing the homework, before continuing. It should be extracted into the same PLT directory (e.g., into c:/cygwin/usr/local/PLT, so that it makes a directory c:/cygwin/usr/local/PLT/collects/homework). See section on getting the homework files below for more details.

Finally, to start using DrScheme after following the above directions, select the ``Typedscm'' language from the Language menu, and then select the course teachpack also from the Language menu. See the Running Scheme web page for more details. Then press the "Run" button.

If you get a message like the following when you press the "Run" button:

The teachpack file C:\cygwin\usr\local\PLT\teachpack\drscheme-342-teachpack.scm did not load properly.

collection-path: collection not found: "homework" in any of: (#<path:c:/cygwin/usr/local/PLT/collects>)

This means that you haven't yet installed the homework files in the right place. See the section on getting the homework files below. After doing that, try using the teachpack again.

Getting Individual Files

If necessary, you can download individual files from both the library from lib342/ and typedscm/ directories. The drscheme-342-teachpack.scm is also available separately. From departmental Unix machines, you can also access the library files from /home/course/cs342/.

Return to top

Customizing for Chez Scheme (localize.scm)

This section only matters if you plan to use Chez Scheme, and is not needed if you only use DrScheme.

For use with Chez Scheme, you must customize the one file not contained in the zip file:

This file is not included in the zip file because it must be customized to your machine. It tells the rest of the library where to find the other files. Because it is tailored to your machine, it must be downloaded individually and customized once. After that you should never have to download it again. Comments in this file indicate what to change to customize it.

See also the library file typedscm/chez/localize-example.scm, which is another example of what would go in your copy of typedscm/chez/localize.scm.

Return to top

Getting Homework Files

You will also need to separately download the homework directory to your machine. This must also be installed as a subdirectory of the PLT/collects directory. That is, if DrScheme is installed in c:\cygwin\usr\local\PLT, then you should have a directory c:\cygwin\usr\local\PLT\collects\homework containing the homework files.

We provide a zip file containing all of the homeworks and their tests. Simply unzip this to your PLT directory.

Return to top

Working with our Test Drivers

The test drivers in lib342/test-homework.scm are loaded automatically. By default they do not show output of tests that are passing. If you want to see more output, execute (show-test-output!); to see less output, execute (hide-test-output!).

Return to top

Other Ways to use the Library

The following describe other ways to use the library that most students can ignore. These may be useful for special purposes or for students using other Scheme systems besides DrScheme.

Getting just Typedscm

There is a zip file containing just typedscm, which omits the test of the library. It should be unzipped into the top-level DrScheme installation directory (PLT), so that you have a directory named PLT/collects/typedscm when finished.

After unzipping, you must run Setup PLT.exe from the PLT directory (on Windows, or bin/setup-plt from the plton Unix). See the setup section above for more details.

Return to top

Scripts for Other Scheme Systems

If are using Chez Scheme instead of DrScheme, you you will need either shell scripts or batch files from $PUB/bin. These are also part of the library, in typedscm/bin. For example, if you are using the Chez Scheme interpreter, then do whichever of the following applies to you:

Whatever scripts you use, be sure to place them somewhere on your PATH so that they can be found from the command line. On Unix or Mac OS X, be sure that they are also made executable.

Return to top

Last modified Sunday, March 19, 2006.

This web page is for the Spring 2006 offering of Com S 342 at Iowa State University. The details of this course are subject to change as experience dictates. You will be informed of any changes. Thanks to Curtis Clifton for help with these web pages. Please direct any comments or questions to Gary T. Leavens.