Your goal in this task is to set up the Lisp environment you'll be using for the rest of this class.
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.
Before doing anything else, try starting Lisp, using the Start
menu or an icon or typing
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.
Allegro Common Lisp: No action needed.
Any other Lisp::
(net.aserve.client:do-http-request "http://www.google.com" :method :head)As long as you don't see an error message, you should be OK.
Make a directory for your EECS 325 code, e.g., in Windows, it might be
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.
startup.cl. Put it in the Allegro Program Files directory, e.g.,
C:\Program Files\acl82\startup.clfor Allegro 8.2.
clinit.cl. Put it in your home directory, i.e.,
lww-init.lisp. Put it in your EECS 325 code 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
Right-click on the icon that starts your Lisp
and select Properties. Set
to your EECS 325 code directory.
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
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.
(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.
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.
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:
extend-match.lispwhich defines the pattern matcher
lisp-critic.lispwhich defines the Lisp Critic
In other Lisp's, you can use the Lisp function
to compile a file, then use
load to load it.
You should only need to compile these files once. In the future, the code
cs325.lisp will automatically load the compiled file. If
you modify or download
lisp-critic.lisp, be sure to re-compile them.
If the CS325 code is working, you can tell many Lisp's to load
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.
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? Send mail to Chris Riesbeck. Put EECS 325 in the Subject.