From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62612 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: use of (defvar ) Date: Sun, 09 Apr 2006 20:29:53 -0400 Message-ID: <87bqvas2ls.fsf-monnier+emacs@gnu.org> References: <87lkuhdsyb.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144629085 5415 80.91.229.2 (10 Apr 2006 00:31:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Apr 2006 00:31:25 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 10 02:31:22 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FSkJK-0002Td-Nv for ged-emacs-devel@m.gmane.org; Mon, 10 Apr 2006 02:31:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSkJK-00029C-8I for ged-emacs-devel@m.gmane.org; Sun, 09 Apr 2006 20:31:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FSkIu-000237-8W for emacs-devel@gnu.org; Sun, 09 Apr 2006 20:30:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FSkIt-00022e-9C for emacs-devel@gnu.org; Sun, 09 Apr 2006 20:30:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSkIt-00022a-1G for emacs-devel@gnu.org; Sun, 09 Apr 2006 20:30:51 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FSkNN-0007sb-FM; Sun, 09 Apr 2006 20:35:29 -0400 Original-Received: from alfajor ([70.55.147.51]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060410003047.GIVG13653.tomts36-srv.bellnexxia.net@alfajor>; Sun, 9 Apr 2006 20:30:47 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 9B8C1D734E; Sun, 9 Apr 2006 20:29:53 -0400 (EDT) Original-To: Dave Love In-Reply-To: (Dave Love's message of "Sun, 09 Apr 2006 14:56:23 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52575 gmane.emacs.gnus.general:62612 Archived-At: >> From the future's point of view (Emacs-22 and up), placing such defvars >> inside eval-when-compile is a bad practice (in the future it may even fail >> to work since there's nothing that guarantees that the content of >> eval-when-compile is actually compiled rather than just eval'd). > Huh? You don't want it compiled -- that's the point. By "compiled" I only mean that it goes through the byte-compiler (before being eval'd). Not that the resulting byte-code is written in the output file. If the content of eval-when-compile were not compiled, then (eval-when-compile (defvar foo)) would be 100% equivalent to a nop. It's only because it's both compiled&eval'd that the byte-compiler notices the defvar and thus silences warnings about subsequent uses of this variable. > You're actually considering changing what eval-when-compile does and > breaking more existing code?? Compiling the content of eval-when-compile before eval'ing doesn't remove/hide any bug AFAIK, quite the opposite. Stefan