unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Shigeru Fukaya <shigeru.fukaya@gmail.com>
To: 17475@debbugs.gnu.org
Subject: bug#17475: 24.3.91; bug of byte-optimize-zerop
Date: Tue, 13 May 2014 00:11:11 +0900	[thread overview]
Message-ID: <25CF6DF4691984shigeru.fukaya@gmail.com> (raw)

`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))
        (byte-compile-delete-errors
         `(and (member ,(nth 1 form) (quote 0 0.0))) t)
        ((list '= (nth 1 form) 0))))

-- Shigeru





             reply	other threads:[~2014-05-12 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 15:11 Shigeru Fukaya [this message]
2014-05-16 21:11 ` bug#17475: 24.3.91; bug of byte-optimize-zerop Shigeru Fukaya
2014-05-20 18:32   ` Stefan Monnier
2014-05-28  0:51   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25CF6DF4691984shigeru.fukaya@gmail.com \
    --to=shigeru.fukaya@gmail.com \
    --cc=17475@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).