Primarily technical blog on Lisp, .NET, C# development.

Tuesday, July 21, 2009

Setting up SBCL and Emacs on Ubuntu 9.04

I am always forgetting how to do this and every now and then I am finding myself installing LISP somewhere so here it goes my how-to so I don't have to google for it anymore... Nothing wrong with googling something though.

1) sudo apt-get install emacs22-gtk sbcl slime

2) add the following lines to .emacs on home folder.

(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/usr/share/common-lisp/source/slime/")
(require 'slime)


To test your installation:

1) Open emacs: (Applications -> Accessories -> Emacs 22 (GTK)
2) Press ALT + X
3) type slime
SBCL will start you should get a prompt like this:
; SLIME 2010-01-19
4) On the prompt type "Hello, World."
You should see this:

; SLIME 2010-01-19
CL-USER> "Hello, World."
"Hello, World."
5) Congratulations! You have just ran the first obligatory application on any language, but in Lisp!
6) To quit SLIME+LISP: press , then type quit
7) To quit emacs: CTRL+X CTRL+C