Node:Whitespace in Lists, Next:Typing Lists, Previous:Lisp Atoms, Up:Lisp Lists
The amount of whitespace in a list does not matter. From the point of view of the Lisp language,
'(this list looks like this)
is exactly the same as this:
'(this list looks like this)
Both examples show what to Lisp is the same list, the list made up of
the symbols this
, list
, looks
, like
, and
this
in that order.
Extra whitespace and newlines are designed to make a list more readable by humans. When Lisp reads the expression, it gets rid of all the extra whitespace (but it needs to have at least one space between atoms in order to tell them apart.)
Odd as it seems, the examples we have seen cover almost all of what Lisp lists look like! Every other list in Lisp looks more or less like one of these examples, except that the list may be longer and more complex. In brief, a list is between parentheses, a string is between quotation marks, a symbol looks like a word, and a number looks like a number. (For certain situations, square brackets, dots and a few other special characters may be used; however, we will go quite far without them.)