Common Lisp

Contents

Environment Setup

SBCL

Emacs

SLY Lisp IDE

QuickLisp package manager

Using Common Lisp with Emacs

Loading and evaluating Lisp code

Jump to definition

Cross-reference

Abort/recovery

Jump to REPL

Reference

Debugging

Useful Libraries

Practical Common Lisp

Chapter 1: Introduction: Why Lisp?

Chapter 2: Lather, Rinse, Repeat: A Tour of the REPL

Chapter 3: Practical: A Simple Database

CDs and Records

Filing CDs

Looking at the database contents

Improving the user interaction

Saving and Loading the Database

Querying the database

Updating Existing Records — Another Use For WHERE

Removing Duplication and Winning Big

Chapter 4: Syntax and Semantics

What's with All the Parentheses?

Breaking Open the Black Box

S-expressions

S-expressions as Lisp Forms

Function calls

Special Operators

Macros

Truth, Falsehood and Equality

Formatting Lisp Code

Chapter 5: Functions

Function Parameter Lists

Optional Parameters

Rest Parameters

Keyword Parameters

Mixing Different Parameter Types

Function Return Values

Functions As Data (Higher Order Functions)

Anonymous functions

Chapter 6: Variables

Variable Basics

Lexical Variables and Closures

Dynamic a.k.a Special, Variables

Constants

Assignment

Generalized Assignment

Other ways to modify places

Chapter 7: Macros: Standard Control Constructs

When and Unless

Cond

And, Or, Not

Looping

dolist and dotimes

do

The Mighty loop

Chapter 8: Macros: Defining Your Own

The Story of Mac, A Just So Story

Macro Expansion Time vs. Runtime

DEFMACRO

A Sample Macro: DOPRIMES

Macro Parameters

Generating The Expansion

Plugging The Leaks

Macro-Writing Macros

Chapter 9: Practical: Building A Unit Test Framework

Two First Tries

Refactoring

Fixing The Return Value

Better Result Reporting

An Abstraction Emerges

A Hierarchy of Tests

Wrapping Up

Chapter 10: Numbers, Characters And Strings

Numbers

Numeric Literals

Basic Math

Numeric Comparisons

Higher Math

Characters

Character Comparisons

Strings

String Comparisons