SLIME on your Phone

SLIME (Superior LISP Interaction Mode for Emacs) is a productive LISP programming environment. If you want to try and follow along with the Practical Common LISP book, it's a necessity. You can read up on SLIME here and Practical Common LISP here

Go to the GooglePlay Store and download Termux, open it, then write

$ pkg install emacs

emacs is now installed on you phone.

Now, write the following to start emacs on your phone

$ emacs

Just key in the following

Ctrl-x 1
Ctrl-x Ctrl-f 

If you get any grief, hit Ctrl-g over and over until you see "Quit" in the mini-buffer(at the bottom of the emacs window). Then you get to start again. Once you have the Ctrl-x Ctrl-f done, the minibuffer will be asking you what file. Type in...

.em Tab

This should auto-complete the file to be edited to ".emacs". Even if it doesn't, type in ".emacs" and copy the following into the .emacs file.

;;;; .emacs file for melpa and Slime
(when (>= emacs-major-version 24)
(require 'package)
 '("melpa" . "")t)

(setq inferior-lisp-program "/usr/bin/ecl")
(require 'slime-autoloads)
(slime-setup '(slime-fancy))
(setq slime-contribs '(slime-fancy)) 

Now save the .emacs config file.

Ctrl-x Ctrl-s
Alt+x list-packages
Ctrl-s slime

Install slime. You can just point an click the package name with your finger. SLIME is now installed, but you can't use it yet. Quit emacs and stop the terminal processes.

$ exit

Installing ECL (Embedded Common LISP)

Common LISP (clisp) and Steel Bank Common LISP (scbl) both had issues in terms of pre-compiled arm64/termux availability at the time of writing. ECL works thanks to its-pointless. Type the following into your termux shell:

$ pkg install wget
$ $PREFIX/bin/wget
$ bash

Its-pointless's repo will be automatically added. If that means nothing to you, don't worry about it. A repo is a repository of executable files (read 'programs'), that fine people put together to make the world more awesome. Type the following in your termux shell to install ecl (Embedded Common LISP):

$ pkg install ecl

Restart emacs and start "slime", and wait.....a while

$ emacs test.lisp
Alt-x slime

You should eventually get a LISP Read Evaluate Print Loop (REPL) prompt like this:


You can now split the screen vertically by pushing Ctrl-3 and hit Ctrl-x Ctrl-f to find a file to edit. You can use Ctrl-c Ctrl-c to compile LISP programs from an editing window and have the REPL 'see' those functtions and variables. I am not the person to tell you what to do from here. Check out Practical Common LISP or these videos by techsnuffle

Word is that LISP is pretty cool. LISP stands for LISt Processing. Peter Norvig, co-writer of "Artificial Intelligence a Modern Approach" is a big fan. Most of his code for this seminal work is in LISP. I want to really learn about and implement Artificial General Intelligence, hence learning LISP.