From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Working with constansts Date: Wed, 13 May 2009 00:59:58 -0400 Organization: A noiseless patient Spider Message-ID: References: <87d4ahylp3.fsf@galatea.local> <000801c9d191$22a21340$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1242193300 21320 80.91.229.12 (13 May 2009 05:41:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 May 2009 05:41:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 13 07:41:33 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M47Dg-0005lv-ML for geh-help-gnu-emacs@m.gmane.org; Wed, 13 May 2009 07:41:32 +0200 Original-Received: from localhost ([127.0.0.1]:34276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M47Dg-0008VF-4Y for geh-help-gnu-emacs@m.gmane.org; Wed, 13 May 2009 01:41:32 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!weretis.net!feeder2.news.weretis.net!feeder.motzarella.org!news.motzarella.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-X-Trace: news.eternal-september.org U2FsdGVkX1/j46tR073eplfhCOZjvOmETG/4knj0PPddV3Wt750wN+V6dVChIg1pJufH5rncb8zURm2pIDU2tE8n54pY1HzEBinXPljeaTvjeZTVVO+Kb3R2m1sH4fkkuxS32xXj+Rnl+zLtHLASnw== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Wed, 13 May 2009 04:59:58 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/hAnnYZGIhOLC3S2cFFWmOM4rOeRGFLko= Cancel-Lock: sha1:x7ovLkByPXpW8fUaQ5tkAMQyq6E= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:169127 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64390 Archived-At: In article , Nikolaj Schumacher wrote: > Richard Riley wrote: > > >> Because this would incur overhead on every assignment, as it would have > >> to check whether the variable being assigned was declared as a constant. > >> Since this is so rarely the case, this overhead could be seen as mostly > >> wasted and unnecessary. > > > > I don't know enough about Lisp than I can only assume that in this case > > it can not be detected at compile time IF you compile to byte/p code. > > "Thanks" to dynamic scoping it cannot be caught at compile time. It could at least generate a warning. > (defconst xxx nil) > > (defun change-xxx () > (setx xxx t)) ;; const or variable? > > (let ((xxx nil)) > (change-xxx)) This should also warn about binding a constant. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***