all messages for Emacs-related lists mirrored at yhetil.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: Sat, 17 May 2014 06:11:55 +0900	[thread overview]
Message-ID: <2ACF714B777A14shigeru.fukaya@gmail.com> (raw)
In-Reply-To: <25CF6DF4691984shigeru.fukaya@gmail.com>

>`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

zerop itself is not an error-free fuction.
I'll change my poroposal code.

(defun byte-optimize-zerop (form)
  (cond ((numberp (nth 1 form))
         (eval form))
	((list '= (nth 1 form) 0))))

-- Shigeru





  reply	other threads:[~2014-05-16 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 15:11 bug#17475: 24.3.91; bug of byte-optimize-zerop Shigeru Fukaya
2014-05-16 21:11 ` Shigeru Fukaya [this message]
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

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

  git send-email \
    --in-reply-to=2ACF714B777A14shigeru.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.