Practical Common Lisp
Introduction: Why Lisp?(绪论:为什么是 Lisp?)
Why Lisp?(为什么是 Lisp?)
Where It Began(Lisp 的诞生)
But I learned Lisp Once, And IT Wasn't Like What You're Describing(但我曾经学过 Lisp,可是跟你所描述的不太一样)
Who This Book Is For(本书面向的读者)
Lather, Rinse, Repeat: A Tour of the REPL(REPL 简介)
Choosing a Lisp Implementation(选择一个 Lisp 实现)
Getting Up and Running with Lisp in a Box(安装和运行 Lisp-in-a-Box)
Free Your Mind: Interactive Programming(放开思想:交互式编程)
Experimenting in the REPL(体验 REPL)
"Hello, World," Lisp Style(Lisp 风格的 “Hello, World”)
Saving Your Work(保存工作成果)
Practical: A Simple Database(实践:一个简单的数据库)
CDs and Records(CD 和记录)
Filling CDs(录入 CD)
Looking at the Database Contents(查看数据库的内容)
Improving the User Interaction(改进用户交互)
Saving and Loading the Database(保存和加载数据库)
Querying the Database(查询数据库)
Updating Existing Records--Another Use for WHERE(更新已有的记录——WHERE 再战江湖)
Removing Duplication and Winning Big(消除重复,获益良多)
Wrapping Up(总结)
Syntax and Semantics(语法和语义)
What's with All the Parentheses?(括号里都可以有什么)
Breaking Open the Black Box(打开黑箱)
S-expressions(S-表达式)
S-expressions As Lisp Forms(作为 Lisp 形式的 S-表达式)
Function Calls(函数调用)
Special Operators(特别操作符)
Macros(宏)
Truth, Falsehood, and Equality(真、假和等价)
Formatting Lisp Code(格式化 Lisp 代码)
Functions(函数)
Defining New Functions(定义新函数)
Function Parameter Lists(函数形参列表)
Optional Parameters(可选形参)
Rest Parameters(剩余形参)
Keyword Parameters(关键字形参)
Mixing Different Parameter Types(混合不同的形参类型)
Function Return Values(函数返回值)
Functions As Data, a.k.a. Higher-Order Functions(作为数据的函数——高阶函数)
Anonymous Functions(匿名函数)
Variables(变量)
Variable Basics(变量的基础知识)
Lexical Variables and Closures(词法变量和闭包)
Dynamic, a.k.a. Special, Variables(动态(特别)变量)
Constants(常量)
Assignment(赋值)
Generalized Assignment(广义赋值)
Other Ways to Modify Places(其他修改位置的方式)
Macros: Standard Control Constructs(宏:标准控制结构)
WHEN and UNLESS(WHEN 和 UNLESS)
COND(COND 宏)
AND, OR, and NOT(AND、OR 和 NOT)
Looping(循环)
DOLIST and DOTIMES(DOLIST 和 DOTIMES 宏)
DO(DO 宏)
The Mighty LOOP(强大的 LOOP)
Macros: Defining Your Own(定义你自己的宏)
The Story of Mac: A Just-So Story(Mac 的故事:只是一个故事)
Macro Expansion Time vs. Runtime(宏展开期和运行期)
DEFMACRO(DEFMACRO 宏)
A Sample Macro: do-primes(一个示例宏:do-primes)
Macro Parameters(宏的形参)
Generating the Expansion(生成展开式)
Plugging the Leaks(堵住漏洞)
Macro-Writing Macros(生成宏的宏)
Another classic macro-writing MACRO: ONCE-ONLY(另一个经典的用于编写宏的宏:ONCE-ONLY)
Beyond Simple Macros(更复杂的宏)
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(总结)
Numbers, Characters, and Strings(数字、字符和字符串)
Numbers(数值)
Numeric Literals(字面数值)
Basic Math(初等数学)
Numeric Comparisons(数值比较)
Higher Math(高等数学)
Characters(字符)
Character Comparisons(字符比较)
Strings(字符串)
String Comparisons(字符串比较)
Collections(集合)
Vectors(向量)
Subtypes of Vector(向量的子类型)
Vectors As Sequences(作为序列的向量)
Sequence Iterating Functions(序列迭代函数)
Higher-Order Function Variants(高阶函数变体)
Whole Sequence Manipulations(针对整个序列的操作)
Sorting and Merging(排序与合并)
Subsequence Manipulations(操纵子序列)
Sequence Predicates(序列谓词)
Sequence Mapping Functions(序列映射函数)
Hash Tables(哈希表)
Hash Table Iteration(哈希表迭代)
They Called It LISP for a Reason: List Processing(LISP 名字的由来:列表处理)
"There Is No List"(“没有列表”)
Functional Programming and Lists(函数式编程和列表)
"Destructive" Operations(“破坏性”操作)
Combining Recycling with Shared Structure(组合回收性函数和共享结构)
List-Manipulation Functions(列表处理函数)
Mapping(映射)
Other Structures(其他结构)
Beyond Lists: Other Uses for Cons Cells(超越列表:点对单元的其他用法)
Trees(树)
Sets(集合)
Lookup Tables: Alists and Plists(查找表:关联表和属性表)
DESTRUCTURING-BIND
Files and File I/O(文件和文件 I/O)
Reading File Data(读写文件数据)
Reading Binary Data(读取二进制数据)
Bulk Reads(批量读取)
File Output(文件输出)
Closing Files(关闭文件)
Filenames(文件名)
How We Got Here(进化历程)
How Pathnames Represent Filenames(路径名如何表示文件名)
Constructing New Pathnames(构造新路径名)
Two Representations of Directory Names(目录名的两种表示方法)
Interacting with the File System(与文件系统交互)
Other Kinds of I/O(其他类型的 I/O)
Practical: A Portable Pathname Library(实践:可移植路径名库)
The API(应用程序接口)
*FEATURES* and Read-Time Conditionalization(*FEATURES* 和读取期条件化)
Packaging the Library(给库打包)
Listing a Directory(列目录)
Testing a File's Existence(测试文件存在)
Walking a Directory Tree(遍历一个目录树)
Object Reorientation: Generic Functions(重新审视面向对象:广义函数)
Generic Functions and Classes(广义函数和类)
Generic Functions and Methods(广义函数和方法)
DEFGENERIC(定义广义函数)
DEFMETHOD(定义方法)
Method Combination(方法组合)