unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Leo Liu <sdl.web@gmail.com>
Cc: 17498@debbugs.gnu.org
Subject: bug#17498: 24.4.50; This function has a compiler macro `yes--cmacro'.
Date: Fri, 16 May 2014 10:59:41 +0200	[thread overview]
Message-ID: <87r43udrpe.fsf@geodiff-mac3.ulb.ac.be> (raw)
In-Reply-To: <m3wqdnkrpt.fsf@gmail.com> (Leo Liu's message of "Thu, 15 May 2014 23:05:18 +0800")

Leo Liu <sdl.web@gmail.com> writes:

> Eval the following code
>
> ;;;; BEGIN
> (defun yes ()
>   )
> (when nil
>   (cl-define-compiler-macro yes (&rest _)))
> ;;;; END

FWIW (and because it was not obvious to me), it's due to
eval-and-compile:

(when nil
   (eval-and-compile (message "foo")))
=> foo is shown in *Messages*

Same with this :
(defmacro bar () '(eval-and-compile (message "foo")))
(when nil (bar))

This case could be "fixed" by optimizing `when' for a nil condition :

(defmacro new-when (cond &rest body)
  (declare (indent 1) (debug t))
  (and cond
       (list 'if cond (cons 'progn body))))

Then
(new-when nil (bar))
doesn't show anything.

-- 
Nico.





  parent reply	other threads:[~2014-05-16  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 15:05 bug#17498: 24.4.50; This function has a compiler macro `yes--cmacro' Leo Liu
2014-05-15 19:43 ` Stefan Monnier
2014-05-16  1:28   ` Leo Liu
2014-05-16 12:24     ` Stefan Monnier
2014-05-16 18:25       ` Leo Liu
2014-05-16  8:59 ` Nicolas Richard [this message]
2014-05-16 18:28   ` Leo Liu

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=87r43udrpe.fsf@geodiff-mac3.ulb.ac.be \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=17498@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /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).