[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17475: 24.3.91; bug of byte-optimize-zerop

From: Shigeru Fukaya
Subject: bug#17475: 24.3.91; bug of byte-optimize-zerop
Date: Tue, 13 May 2014 00:11:11 +0900

`byte-optimize-zerop' is badly implemented.  Even when
`byte-compile-delete-errors' is non-nil, bute-compiled code may
signal an error.
(= FORM 0) and (zerop FORM) are functionally equal, besides, the
former is better when byte-compiled.

The following is the poor alternative.
I can't make a smart code without creating a new function.

(defun byte-optimize-zerop (form)
  (cond ((numberp (nth 1 form))
         (eval form))
         `(and (member ,(nth 1 form) (quote 0 0.0))) t)
        ((list '= (nth 1 form) 0))))

-- Shigeru

reply via email to

[Prev in Thread] Current Thread [Next in Thread]