如何搭建 SLIME 环境

Table of Contents

1 sbcl

brew install sbcl

2 Emacs

brew install emacs

3 Quicklisp

Quicklisp is a library manager for Common Lisp. It works with your existing Common Lisp implementation to download, install, and load any of over 1,500 libraries with a few simple commands.Quicklisp is easy to install and works with ABCL, Allegro CL, Clasp, Clozure CL, CLISP, CMUCL, ECL, LispWorks, MKCL, SBCL, and Scieneer CL, on Linux, Mac OS X, and Windows.

3.1 Slime

curl -O https://beta.quicklisp.org/quicklisp.lisp

sbcl --load quicklisp.lisp

(quicklisp-quickstart:install)

(ql:add-to-init-file)

(ql:quickload "quicklisp-slime-helper")

(quit)

3.2 如上用 quicklisp 包管理工具安装 slime 完成后会输出配置 .emacs 代码

(load (expand-file-name "~/quicklisp/slime-helper.el"))
;; Replace "sbcl" with the path to your implementation
(setq inferior-lisp-program "sbcl")

4 start

M-x slime

5 table notes

命令 属性
C-c C-k Complie and load the current buffer's file
C-c C-c Complie the top-level form at point
M-n slime-next-note
M-p slime-previous-note
C-c C-] slime-close-all-parens-in-sexp
C-c Tab slime-complete-symbol
C-c C-t slime-toggle-fancy-trace
C-c C-w C-c slime-who-calls
C-c Return macroexpand interactively
C-c M-d Disassemble a funtion
C-c I slime-inspect
C-h m Holy grail :)

Last Updated 2018-01-27 Sat 11:01. Created by Siqing Mu