Appendix 4: A primer in Lisp programming

Lisp presents itself to the user as an interpreter; it works both as a programming language and as an interactive system: it waits for some input or command from the user, executes it, and waits again for further input. Lisp is an acronym for List Processor; almost everything in the Lisp world is a list. In programming terms, a list is a set of elements enclosed between parentheses, separated by spaces. The elements of a list can be numbers, symbols, other lists, and indeed, programs. Examples of lists are:

(the number of the beast)(1 2 3 5 8 13)(0.666 (21 xyz) abc)(defun plus (a b) (+ a b))

Lisp is excellent at manipulating lists; there are functions that can do almost any operation you can possibly imagine ...

Get Composing Music with Computers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.