Howto setup sbcl on linux (redhat)

First install Steel Bank Common Lisp (sbcl) , it comes in a bz2 file and installs into /usr/local/bin. If you are using something like Ubuntu, dig around with synaptic installer, because all of this is already done for you, and it is really pretty seamless once you get past a few gotchas.

Next make a link from sbcl to lisp as root or through sudo:

cd /usr/local/bin
ln -s sbcl lisp

Now download slime and add to your .emacs file. Mine was in my home directory for GNU Emacs 21.3.1:

(add-to-list `load-path "~/slime-2009-04-13")
(require 'slime)
(slime-setup)

That’s it, you are done, ‘^M (alt on my keyboard) slime’ starts it up.

After playing around with it a little bit, you will realize that ‘asdf’ is really cool so down it too . To install it, just load it up and you are done.

Programming Langages …

Programming languages teach you not to want what they cannot provide. You have to think in a language to write programs in it, and it’s hard to want something you can’t describe.

                      From the Introduction to ANSI Common Lisp by Paul Graham

Emacs Lisp

; Emacs Lisp

I have been playing around with the lisp integrated into emacs, rather than one that you bring up with slime and run alongside emacs.  Of course the first big difference is that so much is tied to how you call the function, pass it variables, and what it does.  Many if not all of the games are written in emacs lisp and you can go to help, read about them, and then pull up their lisp source.

Lisp cons tree

I am still a lisp newbie, so I don’t know if this is cool or just wierd. Its something I made up a while back when I was first learning about cons associations:

Cons Table (this one is much better than below)


1

0

15

14

cdaaar

caaaar

cddddr

cadddr

caaar

cdddr

2

cadaar

|

|

cdaddr

13

cdaar

caar

cddr

caddr

3

cddaar

|

|

caaddr

12

car

(cons)

cdr

4

caadar

|

|

cddadr

11

cadar

cdar

cadr

cdadr

5

cdadar

|

|

cadadr

10

cddar

caadr

caddar

cdddar

caaadr

cdaadr

6

7

8

9

Installing LISP on Windows

I started with Lisp-in-a-box and it worked pretty well, although I realized that my lisp package involved 3 things:

  1. An Emacs Compiler
  2. CLISP
  3. Slime

With lisp-in-a-box, you aren’t going to get the most current releases of all of these at the same time. So I set out to download my own components. I finally got it working with:

  1. GNU Emacs 22.2
  2. GNU CLISP 2.4.4
  3. SLIME 2008-07-05

The only thing that I have to do that Lisp-in-a-box did for me was type [alt]-x slime to start it up. I highly recommend writing lisp in this REPL interface. You can actually use the autoformatting to see when you have made a mistake. As you add your closing parms (which everyone hates about LISP), the cursor actually flashed back to its corresponding opening parm. This is really cool. If you think you are finishing a loop, you will see instantly if you are right or not. And did I mention using auto-completion on function or variable names to move faster with less mistakes too?

The only tricky configuration I had to do was create a directory called ‘C:\.emacs.d’ and inside it put a file called ‘init’ with this content (of course you have to figure out your own paths):

(add-to-list ‘load-path “C:\\slime”) ; your SLIME directory

(setq inferior-lisp-program “C:\\Progra~1\\clisp-2.44\\clisp.exe -K full”) ; Lisp

(require ‘slime)
(slime-setup)