SLIME - Lisp Development

Table of Contents

Setup

;; Slime Setup
(add-to-list 'load-path "~/slime")
(require 'slime)
(slime-setup)

Starting Slime

M-x slime

Saving your work

Put your lisp code in a file ending in .lisp and you can compile the functions with C-c C-c anywhere after the (defun line. These are now available at the REPL prompt in SLIME

CL-USER>

Switch to output buffer

C-c C-z displays the SLIME output buffer

Loading lisp files

  • Open the .lisp file
  • C-c C-l loads the file in SLIME

Property Lists

p-lists are just lists that are defined by their contents. The elements alternate as symbol and value pairs such as

CL-USER> (list (:a 1 :b 2 :c 3)
(:A 1 :B 2 :C 3)

You retrieve values of a p-list with GETF as in

CL-USER> (getf (list (:a 1 :b 2 :c 3) :b)
2

FORMAT arguments

~a Consume and list argument and print it in human readable form
~10t Emit enough spaces to move to column 10
~% Emit a newline
~{ and ~} Loop over a list processing the enclosed format string

Author: Bernt Hansen

Emacs 23.2.1 (Org mode 8.0.1)

Validate XHTML 1.0