Your goal in this task is to set up the Lisp environment you'll be using for the rest of this class.

Set up Common Lisp

If you have no preference about which Lisp to use, install Allegro Common Lisp. It's available at Franz, Inc.. This will be the Lisp that most students will be using, so you'll get the best local support if you run into trouble.

Allegro comes with two versions: ANSI, which implements the Common Lisp standard, and Modern, which implements a non-standard version compatible with Java libraries. Each version can be run with or without the Integrated Development Environment (IDE). If you use Allegro, be sure to use an ANSI image. I recommend the ANSI IDE. You will get errors with standard third-party libraries if you use a Modern image.

You can use any other Common Lisp that is listed as supported by the portable AllegroServe library for Lisp-based web services.

Warning: Clisp is listed but students have had trouble compiling AllegroServe in Clisp in Linux.

Scheme is not suitable for this course.

Test Lisp

Before doing anything else, try starting Lisp, using the Start menu or an icon or typing lisp in a shell window, or whatever is normal for your platform.

In Allegro, be sure to select ANSI mode (with IDE if available) not Modern mode.

Type a few simple expressions, e.g., (* 23 45), just to make sure everything is working.

If you have problems, ask for help.

Set up AllegroServe

Allegro Common Lisp: No action needed.

Any other Lisp::

Set up the EECS 325 Startup Files

Make a directory for your EECS 325 code, e.g., in Windows, it might be c:\eecs325.

Download cs325.lisp into that directory.

Download a startup file for your Lisp. I have two specifically designed for Allegro and LispWorks. If you're using another Lisp, post to the newsgroup what information you can find about the Lisp initialization files used by your Lisp.

In whatever file you use, use a plain text editor to change the line marked to point to the location of your EECS 325 directory.

If you are using some other Common Lisp, find out what file it loads at start up time and modify it to do what startup.cl does.

Windows tip: Right-click on the icon that starts your Lisp and select Properties. Set Start in: to your EECS 325 code directory.

Test Your EECS 325 Setup

You need to be online the first time you test your setup, because cs325.lisp will download additional code files, if not already on your system.

Start your Lisp. Many Lisps, including Allegro, will automatically load the startup file. LispWorks Personal Edition does not so you will have to use File | Load ... to load it manually. If your Lisp does not have a visual interface, type

(load "c:/eecs325/startup-file")

using the correct location and name of your startup file.

Note: Use "/" in pathnames, not "\". Lisp, Java, C and C++ all recognize "/" as a directory separator, whether you're running on Windows, Unix, or MacOS. Don't use "\" which is only valid for Windows and means something special in Lisp, Java, C and C++.

The startup file should load cs325.lisp. This file executes code that automatically downloads other files, if they're not present on your machine already. Try to fix any error messages you see. If you can't, ask for help.

If there are no errors, type (in-package :cs325-user) to enter the EECS 325 package. This makes EECS 325 functions available to you in the Listener window.

Now type:

(critique (defun foo (x) (setq x (+ x 1))))

This is calling the Lisp Critic. If all has been set up correctly, several critiques of the above code should be printed.

Then type

(get-tests)

This is asking the Lisp Unit Tester what exercises it can test for. A list of several lines of over 60 exercise names should be returned.

If the above actions do something unexpected, ask for help.

Compile the Lisp Critic

The Lisp Critic runs orders of magnitude faster when compiled. In Allegro and Lispworks, all you need to do is use the Compile and Load option in the File menu. Compile and load these two files:

In other Lisp's, you can use the Lisp function compile-file to compile a file, then use load to load it.

You should only need to compile these files once. In the future, the code in cs325.lisp will automatically load the compiled file. If you modify or download extend-match.lisp or lisp-critic.lisp, be sure to re-compile them.

Submit Report

Email to c-riesbeck@northwestern.edu

Making Lisp Life Easier (optional but recommended)

If the CS325 code is working, you can tell many Lisp's to load the cs325.lisp file automatically every time you start Lisp. These Lisp's load some initialization file every time they start. The name and location of this file varies from OS to OS and Lisp to Lisp.

How to Get Help

There's a lot of ways to make trivial errors in configuring any language environment, and most of them lead to fairly cryptic messages and behavior.

The best source of help will be the CS 325 news group.


Comments? Comments icon Send mail to Chris Riesbeck. Put EECS 325 in the Subject.