(eq x nil)

Helmut Eller <[email protected]>
Newsgroups gmane.lisp.cmucl.devel
Message-ID <[email protected]>
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

_______________________________________________
cmucl-imp mailing list
[email protected]
http://lists.zs64.net/mailman/listinfo/cmucl-imp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.