Lisp Notebook by Mihailo Despotovic, January 2012

My exercises from learning Common Lisp over the 2011 holidays, from two text files, running in a small Common Lisp interpreter written for this page. Every box can be edited. Run evaluates the code and the Try line under it, and shows what each expression returns. All boxes share one Lisp, so a function defined in one box can be used in the next, and a later definition replaces an earlier one, as in a real Lisp session. Notes point out my slips, with a fix to load.

Your own Lisp

Command-Return (Ctrl-Enter) runs any box.

The interpreter follows Common Lisp where these exercises depend on it: functions and variables have separate names (hence funcall and #'), defun always defines a global function, whole numbers have no size limit, dividing them gives exact fractions, a number like 1.0 is a single-float and pi a double-float (printed with d0), and only NIL is false. It is a subset, without macros, characters, arrays, hash tables, structures, keyword arguments or multiple values. Stop ends a computation that runs too long, and keeps the functions defined so far; Restart Lisp forgets everything.

The original files