From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: defconst in lao.el Date: Wed, 17 Nov 2004 09:17:49 -0500 Message-ID: References: <200411141856.iAEIuEM24284@raven.dms.auburn.edu> <200411170141.KAA24828@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1100701103 27776 80.91.229.6 (17 Nov 2004 14:18:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 Nov 2004 14:18:23 +0000 (UTC) Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 17 15:18:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CUQdN-0008OG-00 for ; Wed, 17 Nov 2004 15:18:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CUQmB-00040P-4n for ged-emacs-devel@m.gmane.org; Wed, 17 Nov 2004 09:27:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CUQm1-00040G-VM for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:27:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CUQm1-000404-HB for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:27:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CUQm1-000401-ET for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:27:05 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CUQdA-0008Vb-RR for emacs-devel@gnu.org; Wed, 17 Nov 2004 09:17:57 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id CB95D8282E8; Wed, 17 Nov 2004 09:17:55 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5EB784AC465; Wed, 17 Nov 2004 09:17:50 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 08F288CA69; Wed, 17 Nov 2004 09:17:50 -0500 (EST) Original-To: Kenichi Handa In-Reply-To: <200411170141.KAA24828@etlken.m17n.org> (Kenichi Handa's message of "Wed, 17 Nov 2004 10:41:48 +0900 (JST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca 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: main.gmane.org gmane.emacs.devel:29972 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29972 > I used "defconst" for them because they have to be set back > to nil when lao.el is re-loaded. They are setup in the > following (let ...) form to correct values. If we change > them to "defvar", they are anyway set to nil in that (let > ...) form. And, conceptually, they are "constant". So I > think "defconst" is better. > Then, how to avoid the compiler warnings? The problem is > that their initial values are calculated at the same time > (not one by one) in the "let" form. The "right" answer is to put the defconst in the body of the let. Of course if you do that, you get complaints from the byte-compiler because it doesn't see those defconst as being at the top-level and thus doesn't relize that they are *always* defined. We should fix this in the byte-compiler but nobody's done it yet. But you can work around those warnings by adding a couple (defvar foo) before the let. Ugly, tho. Stefan