A DIRECTORY OF FILES USED TO RUN INTERPRETERS FOR THE BOOK ESSENTIALS OF PROGRAMMING LANGUAGES (File $Date: 1998/10/16 02:06:02 $) Gary T. Leavens Department of Computer Science, Iowa State University leavens@cs.iastate.edu The files in this directory go with the Essentials of Programming Languges book by Friedman, Wand, and Haynes (MIT Press, McGraw-Hill). 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) ----------------------------- ch5-1.scm 5.1 ch5-3.scm 5.3 ch5-4.scm 5.4 ch5-5.scm 5.5 ch5-7-1.scm Figure 5.7.1 ch6-1-3.scm Figure 6.1.3 ch6-1-4.scm Figure 6.1.4 ch6-2.scm 6.2 ch6-5-2.scm Figure 6.5.2 ch6-5-3.scm Figure 6.5.3 ch7-1.scm 7.1 ch7-2.scm 7.2 ch7-3.scm 7.3 (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. All the interpreter files undefine both the run and read-eval-print routines. undefine-run undefine-read-eval-print | | ch[567]-[0-9]* For sections 5.3 through chapter 6 (but not 5.1) You have to load either run.scm or rep.scm to use them, by typing: (load-from-lib "run.scm") or (load-from-lib "rep.scm") See the file char-parser-README.txt for more details on these files and how to use run or read-eval-print for other sections. Except for section 5.1, all the interpreters load one of the following files to do syntax expansion. FILE SYNTACTIC SUGARS ------------------------------------------------------- syntax-expand-0.scm (none) syntax-expand-let.scm let syntax-expand-letrec.scm let, letrec, letrecproc syntax-expand-OOP.scm let, letrec, letrecproc (for chapter 7) Note that, if you want to use your own version of syntax-expand, you have to load it (each time) after you load a ch*.scm file. Except for section 5.1, all the interpreters load one of the following files to handle the evaluation of top-level forms. Eval-form is intended to call syntax-expand, and then pass the result to eval-exp. FILE ADDITIONAL TOP-LEVEL FORMS ------------------------------------------------------- eval-form-0.scm (none) eval-form-with-define.scm define, definearray eval-form-for-oop.scm define All the chapter 5 files use ch5-char-parser.scm, the chapter 6 files use ch6-char-parser.scm, etc. For ADTs, we use the following. list-index | ribassoc | ff-as-record | environments cell array The *.def files, such as cell.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. The parsers are organized as follows. record-decl record-procdecl record-keydecl parsed-form | parsed-exp | char-parser | ch5-char-parser The ch6-char-parser, ch7-char-parser, etc. are done in exactly the same way. The remaining details on ch5-1.scm are as follows. undefine-run undefine-read-eval-print environments ch5-char-parser \ / \ / ch5-1 A more standard example for chapter 5 is the following. eval-form-0 compose undefine-run cell undefine-read-eval-print environments ch5-char-parser \ syntax-expand-let \ / ch5-5 For chapter 6, all the files use ch6-base.scm. An example is ch6-1-3.scm. eval-form-with-define syntax-expand-letrec compose undefine-run cell undefine-read-eval-print environments ch6-char-parser array / \ / ch6-base / \ / \ / ch6-1-3 For chapter 7, syntax expansion is different. An example is ch7-1.scm. eval-form-for-oop syntax-expand-OOP compose undefine-run cell undefine-read-eval-print environments ch7-char-parser \ / \ / \ / \ / ch7-1