From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Working with constansts Date: Sun, 10 May 2009 10:02:42 -0700 Message-ID: <000801c9d191$22a21340$0200a8c0@us.oracle.com> References: <87d4ahylp3.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241974986 5556 80.91.229.12 (10 May 2009 17:03:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 May 2009 17:03:06 +0000 (UTC) To: "'Richard Riley'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 10 19:02:56 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 1M3CQR-0006zO-2t for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 19:02:55 +0200 Original-Received: from localhost ([127.0.0.1]:42897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3CQQ-00059c-Di for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 13:02:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3CQ4-00059V-PX for help-gnu-emacs@gnu.org; Sun, 10 May 2009 13:02:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3CPz-00059F-CE for help-gnu-emacs@gnu.org; Sun, 10 May 2009 13:02:31 -0400 Original-Received: from [199.232.76.173] (port=56060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3CPz-00059C-5b for help-gnu-emacs@gnu.org; Sun, 10 May 2009 13:02:27 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:56782 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3CPy-0006En-KD for help-gnu-emacs@gnu.org; Sun, 10 May 2009 13:02:26 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4AH2Gee027653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 May 2009 17:02:17 GMT Original-Received: from abhmt001.oracle.com (abhmt001.oracle.com [141.146.116.10]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4AH2L44003803; Sun, 10 May 2009 17:02:22 GMT Original-Received: from dradamslap1 (/141.144.72.30) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 May 2009 10:02:19 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcnRjlIdxZzgyOQASoSiPiezvNpZJgAAC7+g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: abhmt001.oracle.com [141.146.116.10] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010203.4A07089C.00EE:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:64322 Archived-At: > Why is it called a constant if its not enforced? As the doc says (explicitly): to signal programmer *intention*. It lets human readers of the code know that it is *intended* that no one and no code will change the value. Think of it as a comment to that effect, if you like: "Do not change this value." Coding with clear signals of intention is helpful, and too often overlooked. Conventional distinctions of intention among `defconst' vs `defvar'; `when' and `unless' vs `if' and `cond' vs `and' and `or'; and so on can make a big difference in code legibility. Which in turn eases maintenance and makes it less error-prone. Likewise, wrt names of functions, variables, etc.: good names help maintainers and code borrowers. Likewise, comments - good ones. Likewise, indenting and whitespace generally. All of these things are for human readers of code only. You, like the Lisp reader, can do without them if you like. YMMV. [I knew an excellent (in individual terms) Lisp programmer back in the 80s who never used any whitespace that wasn't strictly needed for the Lisp reader and never commented any code. He (almost) never hit the Return key. Needless to say, no one else could work with his code. He did use reasonable names, however, and he didn't use the same conditional (e.g. `if' or `cond') everywhere. He coded in the way that was easiest to him and that got the point across to the Lisp reader.] Perhaps you have another question: Q. Why isn't it enforced? A. Lisp.