Lisp has been hailed as the world's most powerful programming language, but its cryptic syntax and academic reputation can be enough to scare off even experienced programmers. Those dark days are finally over—Land of Lisp brings the power of functional programming to the people!
With his brilliantly quirky comics and out-of-this-world games, longtime Lisper Conrad Barski teaches you the mysteries of Common Lisp. You'll start with the basics, like list manipulation, I/O, and recursion, then move on to more complex topics like macros, higher order programming, and domain-specific languages. Then, when your brain overheats, you can kick back with an action-packed comic book interlude!
Along the way you'll create (and play) games like Wizard Adventure, a text adventure with a whiskey-soaked twist, and Grand Theft Wumpus, the most violent version of Hunt the Wumpus the world has ever seen.
You'll learn to:
Master the quirks of Lisp's syntax and semantics
Write concise and elegant functional programs
Use macros, create domain-specific languages, and learn other advanced Lisp techniques
Create your own web server, and use it to play browser-based games
Put your Lisp skills to the test by writing brain-melting games like Dice of Doom and Orc Battle
With Land of Lisp, the power of functional programming is yours to wield.
Lisp is Power
Chapter 1 Getting Started with Lisp
Lisp Dialects
Getting Started with CLISP
What You've Learned
Chapter 2 Creating Your First Lisp Program
The Guess-My-Number Game
Defining Global Variables in Lisp
Basic Lisp Etiquette
Defining Global Functions in Lisp
Defining Local Variables in Lisp
Defining Local Functions in Lisp
What You've Learned
Chapter 3 Exploring the Syntax of Lisp Code
Syntax and Semantics
The Building Blocks of Lisp Syntax
How Lisp Distinguishes Between Code and Data
Lists in Lisp
What You've Learned
Lisp is Symmetry
Chapter 4 Making Decisions with Conditions
The Symmetry of nil and ()
The Conditionals: if and Beyond
Cool Tricks with Conditions
Comparing Stuff: eq, equal, and More
What You've Learned
Chapter 5 Building a Text Game Engine
The Wizard's Adventure Game
Describing the Scenery with an Association List
Describing the Location
Describing the Paths
Describing Objects at a Specific Location
Describing It All
Walking Around in Our World
Picking Up Objects
Checking Our Inventory
What You've Learned
Chapter 6 Interacting with the World: Reading and Printing in Lisp
Printing and Reading Text
The Symmetry Between Code and Data in Lisp
Adding a Custom Interface to Our Game Engine
Trying Out Our Fancy New Game Interface
The Dangers of read and eval
What You've Learned
Chapter 6.5 lambda: A Function So Important It Deserves Its Own Chapter
What lambda Does
Why lambda Is So Important
What You've Learned
Chapter 7 Going Beyond Basic Lists
Exotic Lists
Coping with Complicated Data
Creating a Graph
Creating Undirected Graphs
What You've Learned
Chapter 8 This Ain't Your Daddy's Wumpus
The Grand Theft Wumpus Game
Defining the Edges of Congestion City
Building the Nodes for Congestion City
Initializing a New Game of Grand Theft Wumpus
Drawing a Map of Our City
Let's Hunt Some Wumpus!
What You've Learned
Chapter 9 Advanced Datatypes and Generic Programming
Arrays
Hash Tables
Common Lisp Structures
Handling Data in a Generic Way
The Orc Battle Game
What You've Learned
Lisp is Hacking
Chapter 10 Looping with the loop Command
The loop Macro
Using loop to Evolve!
What You've Learned
Chapter 11 Printing Text with the format Function
Anatomy of the format Function
Control Sequences for Printing Lisp Values
Control Sequences for Formatting Numbers
Printing Multiple Lines of Output
Justifying Output
Iterating Through Lists Using Control Sequences
A Crazy Formatting Trick for Creating Pretty Tables of Data
Attack of the Robots!
What You've Learned
Chapter 12 Working with Streams
Types of Streams
Working with Files
Working with Sockets
String Streams: The Oddball Type
What You've Learned
Chapter 13 Let's Create a Web Server!
Error Handling in Common Lisp
Writing a Web Server from Scratch
Building a Dynamic Website
What You've Learned
Chapter 13.5 Functional Programming Is Beautiful
Lisp is Science
Chapter 14 Ramping Lisp Up a Notch with Functional Programming
What Is Functional Programming?
Anatomy of a Program Written in the Functional Style
Higher-Order Programming
Why Functional Programming Is Crazy
Why Functional Programming Is Fantastic
What You've Learned
Chapter 15 Dice of Doom, a Game Written in the Functional Style
The Rules of Dice of Doom
A Sample Game of Dice of Doom
Implementing Dice of Doom, Version 1
Creating an Intelligent Computer Opponent
Making Dice of Doom Faster
What You've Learned
Chapter 16 The Magic of Lisp Macros
A Simple Lisp Macro
More Complex Macros
Macros: Dangers and Alternatives
What You've Learned
Chapter 17 Domain-Specific Languages
What Is a Domain?
Writing SVG Files
Creating Custom Game Commands for Wizard's Adventure Game
What You've Learned
Chapter 18 Lazy Programming
Adding Lazy Evaluation to Lisp
Dice of Doom, Version 2
Making Our AI Work on Larger Game Boards
What You've Learned
Chapter 19 Creating a Graphical, Web-Based Version of Dice of Doom
Conrad Barski has an M.D. from the University of Miami, and nearly 20 years of programming experience. This includes a stint developing an obscure Atari Jaguar game, and working on many medical software projects. Barski is also an avid cartoonist, having created the popular alien Lisp mascot and many graphical tutorials. He currently develops cardiology software and lives in Washington, D.C.
I had a lot of fun with this book. It doesn't take itself to seriously. The use of games to introduce and demonstrate concepts was excellent. And there's lot of useful advice on functional programming in general.
3/3/2011
(5 of 35 customers found this review helpful)
2.0
Look at CLISP before buying.
By Agnostic
from Alpharetta, GA
Comments about No Starch Press Land of Lisp:
The book suggests CLISP as the environment to use and the second half of the book requires extensions only available in CLISP. CLISP may be a great environment, but I can't get past the religous symbol displayed on the welcome screen. I tolerate all religions and think all religions should tolerate each other as well tolerating us non-religous folks. And I think the authors of CLISP have the right to put whatever they want on their welcome screen. But I don't care to feel like I am supporting a religion every time I use the environment, so I am not going use it or download it. I wish I had known this before buying the book as I don't think I will read it now.
11/18/2010
(12 of 31 customers found this review helpful)
3.0
Nice intro to lisp...
By Little Zanooda
from San Jose, CA
About Me Developer, Sys Admin
Pros
Easy to understand
Helpful examples
Cons
Not comprehensive enough
Best Uses
Novice
Student
Comments about No Starch Press Land of Lisp:
This is one of books you can enjoy reading, the examples are easy to follow and accurate.
The thing I did not like is the way the author described other languages like Python and ruby..
They were described as buggy and unreliable programming languages. After years of programming in Python that was a little disappointing to me.
Every programming language is unique in a way, Lisp is great, Python is cool, and ruby is just a delight!