From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: Working with constansts Date: Tue, 12 May 2009 11:44:27 +0200 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 1242121524 8076 80.91.229.12 (12 May 2009 09:45:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 May 2009 09:45:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Richard Riley Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 12 11:45:15 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 1M3oXy-0006L3-VE for geh-help-gnu-emacs@m.gmane.org; Tue, 12 May 2009 11:45:15 +0200 Original-Received: from localhost ([127.0.0.1]:39475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3oXy-0001QL-CU for geh-help-gnu-emacs@m.gmane.org; Tue, 12 May 2009 05:45:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3oXH-0001LQ-RG for help-gnu-emacs@gnu.org; Tue, 12 May 2009 05:44:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3oXG-0001L3-I8 for help-gnu-emacs@gnu.org; Tue, 12 May 2009 05:44:30 -0400 Original-Received: from [199.232.76.173] (port=34638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3oXG-0001Kw-3Z for help-gnu-emacs@gnu.org; Tue, 12 May 2009 05:44:30 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:50673) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3oXF-0001ro-OU for help-gnu-emacs@gnu.org; Tue, 12 May 2009 05:44:29 -0400 Original-Received: from thursday (f051097222.adsl.alicedsl.de [78.51.97.222]) by dd18200.kasserver.com (Postfix) with ESMTP id 6B4301809B539; Tue, 12 May 2009 11:44:31 +0200 (CEST) In-Reply-To: (Richard Riley's message of "Mon, 11 May 2009 03:38:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:64365 Archived-At: 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. (defconst xxx nil) (defun change-xxx () (setx xxx t)) ;; const or variable? (let ((xxx nil)) (change-xxx)) regards, Nikolaj Schumacher