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: Sun, 10 May 2009 14:59:56 -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 1241984449 31206 80.91.229.12 (10 May 2009 19:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 May 2009 19:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 10 21:40:39 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 1M3Et4-000772-Us for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 21:40:39 +0200 Original-Received: from localhost ([127.0.0.1]:59357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3Et4-0004ah-CU for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 15:40:38 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!news.ecp.fr!feeder.motzarella.org!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-X-Trace: news.eternal-september.org U2FsdGVkX19dhj5NVDGOBmf887uq4vR/UaXo14x4ZFezVL14VpwwsOn4NbLazUA9QE6X7GqTJIcsxBI1TLTYaRMlIRarsK6vs+grdfciiN9ZWrbK6Uos4AH5TthrtMArWQ+oGG1YleZ4MsdQuSJc8w== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sun, 10 May 2009 18:59:56 +0000 (UTC) X-Auth-Sender: U2FsdGVkX18WeDtODGcrbWcmwrUZyObWr0ZDx64iUHk= Cancel-Lock: sha1:tWkPqPO/Jdpc/tAvxbKta4chzo0= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:169066 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:64330 Archived-At: In article , Richard Riley wrote: > So really the question would be : why does Lisp not enforce constants > being, err, constant? 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. On the other hand, it would be nice if the byte compiler would warn about this. Declaring a constant could put something in its property list, and the compiler could then warn if it sees assignments to the variable. Some Common Lisp implementations get around the overhead problem by putting constants in a page of VM marked read-only, so a hardware trap is raised if an attempt is made to assign it. -- 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 ***