A repository containing exercises and solutions for the book: Common Lisp: A Gentle Introduction
For each exercise (where possible) I have provided an assertion to test against.
- Open the exercise lisp file in emacs.
- M-x slime (install Slime addon if missing)
- Add the function required to make the assertion pass.
- Ctrl+Alt+x your defun.
- Ctrl+Alt+x the assertion;
- if it has completed successfully NIL will appear in the bottom bar of emacs
- if it has failed, a error will appear in your repl
Sdraw will render your objects using similar notation to what is in the book. To use it in your repl perform the following steps:
- In your repl, execute
(load "sdraw.lisp")
- You can now call sdraw:
(sdraw:sdraw (list 1 2 3))
- You should observe something like the following in your REPL:
[*|*]--->[*|*]--->[*|*]--->NIL | | | v v v 1 2 3
Dtrace will trace your function calls more thoroughly than trace can. To use dtrace in your repl perform the following steps.
- In your repl, execute
(load "dtrace.lisp")
- You can now call dtrace:
(defun my-add (a b) (+ a b)) (dtrace my-add) (my-add 1 2)
- You should observe something like the following in your REPL
----Enter MY-ADD | Arg-1 = 1 | Arg-2 = 2 \--MY-ADD returned 3 3