title: Lisp: Can't detect empty list (list nil)?
body: <p>I am trying to write a simple program to detect a list is empty <code>(list nil)</code> or not. However, when I run the following piece of code:</p>
  <pre><code>(defvar emptyList (list nil))
  (if (not emptyList)
      (print &quot;emptyList is empty.&quot;)
  )
  </code></pre>
  <p>Nothing is printed, meaning that <code>(not emptyList)</code> evaluated to <code>false</code>. This seems strange, since I though that <code>(not emptyList)</code> is the correct way to determine whether <code>emptyList</code> is empty or not?</p>