Using and Installing CLISP


CLISP is installed on the Linux machines in the EBW lab. You can SSH into (through ew39) and use 'clisp' to invoke the program.


If you wish to install CLISP on your windows machine, download it from:
CLISP download
unzip it(the paths I give after this assume you install to c:\ and keep the zip file's directory structure/folder names)
execute c:\clisp-2.30\install.bat
answer options however you want
The desktop shortcut is fine if you are going to be working without accessing files. When working with files, it is convenient to set your working directory before starting CLISP. When starting CLISP from the command line, you have to specify two parameters. I use a batch file (c:\clisp.bat) with the following two lines.

cd c:\lisp\workingdir
c:\clisp-2.30\lisp -B "C:/clisp-2.30/" -M "C:\clisp-2.30\lispinit.mem"

Either click the shortcut or enter command line to start CLISP. This should bring up the CLISP intro screen and give you a lisp command line.

Starting CLISP

Starting CLISP should bring up an ascii CLISP intro graphic followed by copyright information and then the command line:

(CLISP intro ascii graphic)

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2002


to make sure it works, try some simple things:

[1]> (+ 2 3) 5
[2]> (print "hello world")
"hello world"
"hello world"

define a function:

[3]> (defun hello-name (name) (format nil "Hello ~A" name))
[4]> (hello-name 'matt)
"Hello MATT"

Hypothetically, you can do everything from the command line. But as your programs get bigger, it will make more sense to use files.

Enter the following in a text file and save it as "power.lisp" in your working directory.

(defun power (x y) (if (= y 0) 1 (* x (power x (1- y)))))

then load it in CLISP:

[5]> (load "power.lisp")
;; Loading file power.lisp
;; Loaded file power.lisp
[6]> (power 3 4)

use (quit) to exit the CLISP program.

Useful Links

CLISP homepage

Good lisp introduction

Lisp links

in depth Lisp primer

CLISP reference

Good debugging suggestions 1

Good debugging suggestions 2