In this chapter, we discussed how conditions work in Lisp. Along the way, you learned the following:
The values nil
, 'nil
, ()
, and '()
are all basically the same thing in Common Lisp.
Lisp makes it easy to check for empty lists. This makes it simple to write list-eaters.
Lisp conditionals, such as the if
command, cause Lisp code to be evaluated only under the right conditions.
If you need a conditional command that does everything, then you want to use cond
.
Comparing stuff in Lisp is complicated, but you can get by if you just use eq
for comparing symbols and equal
for comparing everything else.
3.145.179.225