Leanpub Header

Skip to main content

Learning Common Lisp

A Complete Guide to Common Lisp Programming from First Principles to Advanced Metaprogramming

This book is 100% completeLast updated on 2026-07-22

Discover the power of Common Lisp through a clear, practical guide that takes you from your first S-expression to advanced macros, CLOS and the condition system. Learn not just how Lisp works but why it remains one of the world's most influential programming languages.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
163
Pages
About

About

About the Book

This book takes you from your first S-expression to advanced metaprogramming techniques, covering the full breadth of Common Lisp. You will learn not only how to write Lisp code but why Lisp works the way it does: its design philosophy, its historical roots, and the practical engineering principles that make it one of the most powerful programming languages ever created. Every concept is explained with complete, working code examples built on SBCL, the leading open-source Common Lisp implementation. Whether you are a curious programmer exploring functional and symbolic programming for the first time or an experienced engineer seeking to master macros, CLOS, and Lisp's legendary condition system, this book provides a systematic path from beginner to advanced practitioner.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 400 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

A Complete Guide to Common Lisp Programming from First Principles to Advanced Metaprogramming

Introduction: Why Lisp Still Matters

  1. What You Will Learn
  2. How to Use This Book
  3. The Lisp Mindset

Chapter 1: The Lisp Way of Thinking

  1. A Language That Thought Differently
  2. Code as Data: The Fundamental Insight
  3. Installing Your First Lisp Environment
  4. Reading Your First S-Expression
  5. Interactive Development: The REPL as Your Laboratory

Chapter 2: Core Syntax and Data Structures

  1. Atoms, Symbols, and Literals
  2. Lists: The Foundation of Everything
  3. Vectors, Arrays, and Hash Tables
  4. Strings and Characters
  5. Type System Overview

Chapter 3: Functions and Control Flow

  1. Defining Functions with DEFUN
  2. Lambda Expressions and Anonymous Functions
  3. Conditionals: IF, COND, AND, OR, WHEN, UNLESS
  4. Loops: The LOOP Macro and Alternatives
  5. Multiple Values

Chapter 4: Recursion and Higher-Order Programming

  1. Recursive Thinking: From Iteration to Recursion
  2. MAPCAR, REDUCE, and Functional Higher-Order Tools
  3. Closures: Functions That Remember
  4. Tail Call Optimization and Efficient Recursion
  5. Building Your Own Higher-Order Utilities

Chapter 5: Lexical Scope and the Environment Model

  1. Lexical Binding and LET Forms
  2. Dynamic Binding and Special Variables
  3. Parameter Passing: Required, Optional, Rest, and Keyword Arguments
  4. The Environment Model: How Lisp Resolves Names
  5. Common Scoping Pitfalls and How to Avoid Them

Chapter 6: Macros and Metaprogramming

  1. Why Macros Exist: The Limits of Functions
  2. Your First Macro: DEFMACRO Explained Step by Step
  3. Pattern Matching and Template Writing
  4. Hygienic Concerns and Variable Capture
  5. Real-World Macros: DSLs, Domain-Specific Languages
  6. Advanced Metaprogramming: Compile-Time Computation

Chapter 7: The Common Lisp Object System (CLOS)

  1. Classes and Instances: DEFCLASS and Slot Definitions
  2. Generic Functions and Multiple Dispatch
  3. Method Combination: Beyond Simple Inheritance
  4. The Metaobject Protocol: Programming the Object System
  5. Practical OOP in Lisp: When to Use CLOS

Chapter 8: Error Handling and the Condition System

  1. Conditions vs Exceptions: A Different Model
  2. Signaling Errors and Warnings
  3. Handlers and Restart Functions
  4. Defining Custom Conditions and Restarts
  5. Interactive Debugging with the Condition System

Chapter 9: Packages and Modular Programming

  1. The Package System: Namespaces Done Right
  2. Exporting and Importing: Controlling Visibility
  3. Project Structure for Real Applications
  4. Build Systems: ASDF and Quicklisp
  5. Testing Frameworks: FiveAM and Test Driven Development

Chapter 10: Performance and Optimization

  1. Understanding SBCL’s Compilation Model
  2. Type Declarations: Telling the Compiler What You Know
  3. Profiling and Measuring Performance
  4. Memory Management and Garbage Collection
  5. When to Optimize: Premature Optimization in a Dynamic Language

Chapter 11: Concurrency and Parallelism

  1. Threads in Common Lisp
  2. Synchronization Primitives
  3. Shared State and Race Conditions
  4. Message Passing and Actor-Like Patterns
  5. Parallel Computation: Dividing Work Across Cores

Chapter 12: Building Real Applications

  1. Web Development with Lisp
  2. Database Access and Persistence
  3. Interoperability: Calling C, FFI, and Foreign Libraries
  4. Command-Line Tools and Daemons
  5. Modern Development Workflows

Conclusion: The Future of Lisp Thinking

  1. What You Have Learned
  2. Lisp’s Influence on Modern Programming
  3. Why Lisp Remains Relevant
  4. Career Considerations
  5. The Lisp Community
  6. Continuing Your Journey
  7. Final Thoughts

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub