From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: Working with constansts Date: Mon, 11 May 2009 03:38:49 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: <87d4ahylp3.fsf@galatea.local> <000801c9d191$22a21340$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242006194 16820 80.91.229.12 (11 May 2009 01:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 May 2009 01:43:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 11 03:43:04 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 1M3KXo-0006oY-9v for geh-help-gnu-emacs@m.gmane.org; Mon, 11 May 2009 03:43:04 +0200 Original-Received: from localhost ([127.0.0.1]:43155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3KXn-00081q-S0 for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 21:43:03 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!news.k-dsl.de!feeder.motzarella.org!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: news.eternal-september.org U2FsdGVkX18eucSQnprBC1QkBjlm0MUXjP12xKj8VdAfsJmhvawNR/VwTW9/Pw2xaEn85IAXZQQuxFLG98vxE7S+uykbIkcaqMDqL6pFb7sjs0/HtQATHQIVtkNAEFHQvYuw23ywLLBvoqYIGNyFDw== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Mon, 11 May 2009 01:38:49 +0000 (UTC) X-Auth-Sender: U2FsdGVkX196XeV9Sey9jhmd3sFpa8RlNArcxypyXpiOmYhTaMfzSQ== Cancel-Lock: sha1:ZEB0kJkODuWsm5F1extMAyz8xts= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:169070 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:64333 Archived-At: Barry Margolin writes: > 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. 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. > > 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. This makes sense. My initial enquiry was kind of "yeah, thats the way you say it is, but should it really be like that". If you get my drift.