moji

moji

common lisp

lisp

lisp

image source twinkl.co.uk

setting up

Install SBCL and rlwrap (a better repl wrapper)

˜ sudo apt-get install sbcl

run with

˜ sbcl

or

˜ rlwrap sbcl

Install quicklisp

˜ curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp ˜ sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \ ˜ --eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \ ˜ --eval '(ql:add-to-init-file)' \ ˜ --quit

This will install Quicklisp to the ~/.quicklisp/ directory.

Install emacs. This will need the latews emacs (2.7+) in necessary compile foem source.

˜ sudo apt install emacs

emacs from source:

˜ sudo apt install autoconf texinfo libgif-dev libjwt-gnutls-dev libgccjit-8-dev ˜ git clone git://git.savannah.gnu.org/emacs.git ˜ cd emacs ˜ git checkout emacs-28 ˜ ./autogen.sh ˜ ./configure --with-native-compilation ˜ make -j$(nproc) ˜ make install

If you need to install the newest git (especially on debian) uninstall the ald one and

˜ sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip ˜ wget https://github.com/git/git/archive/refs/tags/v2.43.0.zip -O git.zip ˜ unzip git.zip ˜ cd git-* ˜ make prefix=/usr/local all ˜ sudo make prefix=/usr/local install

doom emacs ([dirto tubes intro](https://www.youtube.com/watch?v=37H7bD-G7nE)):

˜ git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs ˜ ~/.config/emacs/bin/doom install

add doom emacs to your path in .bashrc or zshar or whatever

˜ export $PATH=$HOME/.config/emacs/bin:$PATH

check the installatin by running

˜ ˜ doom doctor

Install Slime

˜ sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit

Then, add this to your ~/.config/emacs/lisp/init.el:

˜ (load (expand-file-name "~/.quicklisp/slime-helper.el")) ˜ (setq inferior-lisp-program "sbcl")

Now that you’ve installed SLIME, you can run it by running Emacs and typing M-x (leftAlt-x) slime. That is: the Alt key along with the x key, then type slime in the little buffer at the bottom. Press enter, and a REPL will start.

keybindings

doom

˜ M-x commands. e.g. slime ˜ C-x o chnage to other window ˜ S-. file browser ˜ C-x C-s save file back to disk ˜ S-w v vertical split ˜ S-w c close current window ˜ S-w q close window and quit of last ˜ S-w w move to other window ˜ S-w n new window ˜ SPC-w +/- increase and decrease window height ˜ SPC-w >/< increase and decrease window width ˜ S-b s save buffer ˜ S-b B list buffers to switch to ˜ S-q q quit

slime

˜ C-c C-r send line to repl ˜ C-c C-c Compile the top-level form at point