Code Is Data

Have you ever heard your friendly (but annoying) neighborhood Lisper loudly proclaim that “Code is data!” and wondered why in the heck anyone would store source code in a database? OK, of course you know that’s not what she means, but it’s not necessarily obvious what the expression does mean.

So let’s drill in: she means that the code itself is constructed using only the data structures in the language. Non-Lisp languages, on the other hand, usually have code with some relatively large syntax, where the syntax for their data structures is just a small subset of the full language syntax. This is much easier to visualize with an example, so let’s take a look at the data structures contained in a bit of Clojure code from clojure.core ...

Get Mastering Clojure Macros 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.