[ Home | Administration | Assignments | Handins | Newsgroup | Notes | Resources ]

Resources

For your interpreter code to work, you should load the file match.ss at the beginning of each homework file. A short tutorial of match is at match.ps or at match.pdf .

As the semester progresses, you can look at individual files in the directory to find the specific examples you're after.

Reference

The two reference works you're most likely to want are available online. The first is the actual specification of Scheme that the pros use, and the second is a more gentle reference. The Chez Scheme User's Guide is also available.

The final reference is to "Computation and Deduction", by Frank Pfenning. It presents a logic programming system (Elf) different from the one that we have used. Elf incorporates types in a more fundamental way than we have done.

Software

Scheme

Petite Chez Scheme is now available from http://www.scheme.com. No MacIntosh version (sorry), but very nice versions for both Win32 systems, Linux, and various other Unices.

Emacs

If you're running Linux, you already have Emacs. If you're running a Win32 setup, you can get one.

There are three levels of customization you might want from your Emacs in terms of this course.

Quick and Dirty

If you're not yet comfortable with Emacs and you don't want to make your emacs very customized (in order to stay somewhat standard), just add the following three lines to your emacs configuration file

(autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t)
(autoload 'run-scheme "cmuscheme" "Switch to interactive Scheme buffer." t)
(setq auto-mode-alist (cons '("\\.ss" . scheme-mode) auto-mode-alist))
Under Unix, your emacs configuration file is a file in your home directory called .emacs (that's pronounced ``dot-emacs''; don't forget the dot). Under Win32 systems, it's a file in your home directory (that's the directory pointed to by environment variable %HOME%, or C:\ if there is no such variable) called _emacs (``underscore-emacs'').

Normal IU Setup

Those of us who (fortunately or unfortunately) have to write a lot of Scheme code have made a few changes to the default Scheme mode in Emacs, and put together a package called iuscheme.el. If you want to use it, first make sure you have a place to put emacs-lisp files (which have the extension ``.el''). Assuming you've chosen to place them in the directory ~/emacs, download the package, place it there, and make sure you have the following expression in your emacs configuration file:

(setq load-path (cons "~/emacs" load-path))

Then, all you need to do is make sure these three lines are in your configuration file

(autoload 'scheme-mode "iuscheme" "Major mode for Scheme." t)
(autoload 'run-scheme "iuscheme" "Switch to interactive Scheme buffer." t)
(setq auto-mode-alist (cons '("\\.ss" . scheme-mode) auto-mode-alist))

Insane Setup

If you write as much Scheme code as some of us do, you may be willing to undergo behaviour modification if it would allow you to never make an unbalanced-parenthesis-type error ever again. If this sounds like a good idea to you, then first follow the directions for the Normal IU setup. Then, download balanced.el, stick it in your emacs-lisp directory, and add the following lines to your configuration file

(autoload 'balanced-toggle "balanced" "Toggle balanced ``mode''" t)
(autoload 'balanced-on "balanced" "Turn on balanced ``mode''" t)
(add-hook 'scheme-mode-hook 'balanced-on)
Now, every time you insert a left parenthesis while working on a Scheme file, the matching right parenthesis will automatically be inserted. Hitting a right parenthesis will move you past the next right parenthesis. ``M-1 ('' (Meta-one, left parenthesis) will surround the next ``s-expression''. Etc, etc.

If you use this, you'll want to brush up on M-C-f, M-C-b, M-C-u, M-C-d, M-C-k, and M-C-space.


This information was taken nearly verbatim from an earlier C311 course web page written by Erik Hilsdale, ehilsdal@cs.indiana.edu.

Last modified: Mon Apr 15 19:17:32 EST 2002