2. Conses, Lists, and Trees

While you also have hash tables (see Chapter 6) and arrays (see Chapter 5), conses and lists remain the most important building block for data structures in COMMON LISP, if only because that’s how the internal representation of your code is realized and you’ll thus need them if you want to write macros and domain-specific languages. Also, because COMMON LISP has such a plethora of built-in convenience functions to manipulate conses and lists, and because conses are at the same time very simple yet extremely versatile, there are lots of situations where you should just use them (whereas if you’re coming from another programming language, your first instinct might tell you to use, say, arrays). Some of the recipes in ...

Get Common Lisp Recipes: A Problem-Solution Approach 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.