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

Wednesday, January 20, 2010

Installing SBCL + SLIME on Ubuntu 9.10

Today I tried to upgrade my lisp environment that is using clbuild to keep track of the packages just to be annoyed by its failure. I was just trying to check how hard it would be to do that in my everyday environment. Because of the failure I decided to try other alternatives. This time I tried Lispy which is is defined as (from their website)

"Lispy is a library manager for Common Lisp, written in Common Lisp. All of its dependencies except for GPG (with which signed maps and releases are verified) are written in portable Common Lisp. With this approach you should only need a Lisp implementation installed to get started. The Lispy project has two goals:
  1. Implement an easy to use, portable library manager.
  2. Provide a wealth of ready to install libraries."
 Ok. I liked the concept. I followed their guide and was able to have it working on my sbcl 1.0.29 version alrady installed on the machine. I only had one issue because it couldn't find the gpg key. I had to serach for it using a different server:

$ gpg --keyserver --search-key 0x7CF49723

All was well but I decided to also get the latest from sbcl (1.0.34) and slime as well.

Installing sbcl was very straight forward and I had no issues. Installing slime however was a pain. I got it from the cvs and I set it up just like the getting started page suggested but I could not get to the slime-repl buffer. So after searching the page for known issue I found this:
The REPL moved to a contrib. Instead of (slime-setup), place
(slime-setup '(slime-fancy slime-asdf)) into your ~/.emacs.
So I ended up with a different .emacs file then before:
(add-to-list 'load-path "your-path-to-slime")
(require 'slime)
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
(setq inferior-lisp-program "sbcl")
(slime-setup '(slime-fancy slime-asdf))
Next post I will tell my journey to get a web site running on the good old hunchentoot. 

Wednesday, January 6, 2010

Connecting to a database from Lisp

This is another reminder to myself on how to connect to a database on Lisp using cl-sql through odbcunix.

(use-package :cl-sql)
(connect '("dsn" "user" "password") :database-type :odbc)
(query "select * from table_a")