From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: unused local variables Date: Fri, 30 Nov 2007 16:31:31 +0100 Message-ID: References: <87wss1qd9e.fsf@ambire.localdomain> <20071130.092322.193982611.kazu@iij.ad.jp> <20071130.182726.126856507.kazu@iij.ad.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196436706 28573 80.91.229.12 (30 Nov 2007 15:31:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2007 15:31:46 +0000 (UTC) Cc: =?UTF-8?Q?=E5=B1=B1=E6=9C=AC=E5=92=8C=E5=BD=A6_Kazu_Yamamoto?= , emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 30 16:31:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Iy7qL-00022n-ML for ged-emacs-devel@m.gmane.org; Fri, 30 Nov 2007 16:31:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy7q5-0008DM-VR for ged-emacs-devel@m.gmane.org; Fri, 30 Nov 2007 10:31:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iy7q2-0008Ax-Cz for emacs-devel@gnu.org; Fri, 30 Nov 2007 10:31:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iy7q0-0008AB-Vr for emacs-devel@gnu.org; Fri, 30 Nov 2007 10:31:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy7q0-0008A8-QW for emacs-devel@gnu.org; Fri, 30 Nov 2007 10:31:32 -0500 Original-Received: from wa-out-1112.google.com ([209.85.146.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iy7q0-0007LA-FX for emacs-devel@gnu.org; Fri, 30 Nov 2007 10:31:32 -0500 Original-Received: by wa-out-1112.google.com with SMTP id k34so2851018wah for ; Fri, 30 Nov 2007 07:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=2t47/zG/W9eMCTS5WXIjpjuNCyRhwHWHIfboowyb83I=; b=Lc4k+i3PNtF+TdrgzahuXBPmjCYhkIj1tfPdl20lUaPdBPI7n6K4uNiTC1kFvgs3LKUpOm215CO17bduUIPzVNkaSTMonFYCAU4fXGJosQ0gr7K9BuJEQMVKlJHCfffpKsXiuIB7inpR8EMZFpT3Q8J84vEnaAsFdj+FMmwfMtg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ww+B8Hme8u0x3sl/qDH41XvMKUw4SiziUKXEOQT7sOqC09qA4pax4R4XYm776+lmTtJLUAKdb5EeCpw0JpmmsN7AiwSXE5fJ7RI/Mhc+leKxd3UfwF4MF2lpAStdlfy4PFRSLF/LaqkCWgRzpOCPVzpTw6YJt/lZ7N1pAEmfSDY= Original-Received: by 10.115.33.1 with SMTP id l1mr289492waj.1196436691301; Fri, 30 Nov 2007 07:31:31 -0800 (PST) Original-Received: by 10.114.170.5 with HTTP; Fri, 30 Nov 2007 07:31:31 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:84359 Archived-At: On Nov 30, 2007 4:10 PM, Stefan Monnier wrote: > Yes. And that's good. As I've said, I'm all for a lexically-scoped elisp. But I'm a bit worried by introducing warnings for things that are not "wrong" (or, at least, weren't until now). > E.g. if you want to compile this file with the > lexical-scoping version of Emacs that Miles has been working on, this > is indispensable. Any hope of that branch merged with the trunk sometime? > BTW, in the above example, the byte-compiler already complains in the > `test' function, so it's not like it's going to make that big > a difference. As shown in a previous message, there's no warning if the function tests whether my-dynamic-variable is bound. > Also dynamic scoping is sufficiently odd and rarely used that it deserve > special mention in the code. It's pretty common to mark it with > a comment. And code is always better than a comment since it tends to > bitrot a bit less quickly. I agree that code is better than a comment. I'm not sure I agree that dynamic scoping is "odd and rarely used" in elisp packages. > PS: Another "unused var" warning which we should add (I don't have it > in my lock hack yet, tho) is the one that notices when a `defvar' > declares a variable which is not used in the file. That one seems useful, yes. byte-compiler-silencing `defvar's (and now `define-function's), like `require's (and C #include's), tend to accumulate even when they cease to be necessary. Juanma