A DIRECTORY OF FILES USED TO RUN (TYPED) INTERPRETERS FOR SECOND EDITION OF THE BOOK ESSENTIALS OF PROGRAMMING LANGUAGES (File $Date: 2005/02/17 19:03:57 $) Gary T. Leavens Department of Computer Science, Iowa State University leavens@cs.iastate.edu The files in this directory go with the second edition of the book Essentials of Programming Languges,book by Friedman, Wand, and Haynes (MIT Press, 2001). They work under DrScheme (MzScheme) and Chez Scheme. This file documents the organization of the files, in terms of what to load from where. The interpreter files for each section of the book are named after the section of the book, or occasionally, after a figure in a section. FILE FOR SECTION (OR FIGURE) ----------------------------- 3-1.scm 3.1 3-3.scm 3.3 3-4.scm 3.4 3-3.scm 3.5 (etc.) To display the organization in discussions below, we use the notation: A B | C which means that file C.scm loads both A.scm and B.scm. For ADTs, we use the following. environment-as-ribcage cell array The *.def files, such as displayln.def, are used by our type checker, found in type-check*.scm. If you are not doing type checking using it, you can safely ignore these files. However, if you're not using the type checker, you will need to also load the file type-check-ignore-types-at-runtime.scm, if you are using Chez Scheme, or drscheme/type-check-ignore-types-at-runtime.scm if you are using DrScheme. For our type checker to work, we have to include in the code the define-datatype declarations instead of just having SLLGEN generate them. The SLLGEN specification of the grammar is pushed off into a *-grammar.scm file, so as not to clutter up the main file too much. Each interpreter uses a file that defines its denoted and expressed values as ADTs. There are, for example, 3-1-denoted-value.scm and 3-1-expressed-value.scm, for the interpreter of section 3.1 The remaining details on 3-1.scm are as follows. inject-extract | 3-1-grammar 3-1-denoted-value environment-as-ribcage 3-1-expressed-value \ / 3-1 The file localize.scm in the current directory has to be tailored along the lines described in localize-example.scm to define various global variables used by other files. You may have not received this file, since it's not included in the zip files. If so, you need to create one using localize-example.scm as an example. Then, to work with DrScheme, you must install this directory under PLT/collects in a subdirectory named lib342. So this directory would be PLT/collects/lib342. Then either select the typedscm language or use the drscheme-eopl-teachpack.scm file as a teachpack. If you use the teachpack you have to select the MzScheme language first. You can't use the teachpack with the Typedscm language. To work with Chez Scheme, besides making localize.scm, you also need to create a file chez-localize.scm and define the path in that file. See the file chez-localize-example.scm for an example. To use Chez Scheme, you need to use a (Unix shell) script or batch file like the following... #! /bin/sh : ${PLTCOLLECTS='/opt/plt/collects/'} : ${SCHEME_LIBRARY_PATH="$PLTCOLLECTS/slib/"} export SCHEME_LIBRARY_PATH exec scheme "$PLTCOLLECTS/lib342/chez-localize.scm" "$PLTCOLLECTS/lib342/translate-module-syntax.scm" "$PLTCOLLECTS/lib342/standardize-chez.scm" "$PLTCOLLECTS/lib342/type-check-and-eval.scm" "$@" The chez-localize.scm file has to be loaded first. The file translate-module-syntax.scm translates the subset of MzScheme's module syntax that we use into Chez Scheme's syntax. It's important to load that second. The file standardize-chez.scm is used when the Chez Scheme interpreter is used. There is a similar file for DrScheme. The type-check-and-eval.scm starts the (old) type checker, tc-eval.scm the one under development. If you don't want to do that use instead the file type-check-ignore-types-at-runtime.scm. See the bin directory for various example versions of these scripts.