[cmucl-imp] (eq x nil)

Helmut Eller heller at common-lisp.net
Sat Jan 8 09:12:35 CET 2011


The compiler transforms (null x) and (not x) to (if x t nil).
We could to the same for (eq x nil).  That would make a small difference
in code like:

(defun foo (x z)
  (cond (x 1)
        ((eq x nil) 2)
        (z 3)))

(defun bar (x z)
  (cond (x 1)
        ((not x) 2)
        (z 3)))

In bar, the compiler is able to remove the z test.

Helmut



More information about the cmucl-imp mailing list