What You've Learned

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.

Get Land of Lisp 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.