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 09:31:07 -0700 Message-ID: <000701c9d18c$b905c700$0200a8c0@us.oracle.com> References: 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 1241973111 619 80.91.229.12 (10 May 2009 16:31:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 May 2009 16:31:51 +0000 (UTC) To: "'Decebal'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 10 18:31:41 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 1M3BwC-0002FR-Rz for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 18:31:41 +0200 Original-Received: from localhost ([127.0.0.1]:47667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3BwC-0000T1-Ab for geh-help-gnu-emacs@m.gmane.org; Sun, 10 May 2009 12:31:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3BvV-0000IY-Lj for help-gnu-emacs@gnu.org; Sun, 10 May 2009 12:30:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3BvS-0000H4-1b for help-gnu-emacs@gnu.org; Sun, 10 May 2009 12:30:57 -0400 Original-Received: from [199.232.76.173] (port=44404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3BvR-0000Gy-NR for help-gnu-emacs@gnu.org; Sun, 10 May 2009 12:30:53 -0400 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:63368) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3BvR-0001Ev-3U for help-gnu-emacs@gnu.org; Sun, 10 May 2009 12:30:53 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4AGV6bP015720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 May 2009 16:31:08 GMT Original-Received: from abhmt003.oracle.com (abhmt003.oracle.com [141.146.116.12]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4AGVAO6008673; Sun, 10 May 2009 16:31:10 GMT Original-Received: from dradamslap1 (/141.144.88.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 May 2009 09:30:44 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcnRhhXmEsbTSKBxTV+tDs3ZnkztMQABdtpw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: abhmt003.oracle.com [141.146.116.12] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A09020B.4A070135.0081: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:64318 Archived-At: > I would like to work with constants in my elisp code. I thought that I > could do this with defconst, but that doen not work. > After: (defconst dummy "testing") > The variable dummy has the value "testing". > But after: (setq dummy "changed") > The variable dummy has the value "changed". > What am I doing wrong. >From the Elisp manual: "The difference between `defconst' and `defvar' is primarily a matter of intent, serving to inform human readers of whether the value should ever change. Emacs Lisp does not restrict the ways in which a variable can be used based on `defconst' or `defvar' declarations. However, it does make a difference for initialization: `defconst' unconditionally initializes the variable, while `defvar' initializes it only if it is void." Nothing prevents a user or program from changing the value of a `defconst' variable. Unless you somehow cripple Emacs Lisp, you can always find a way to modify something. That's about the only constant. ;-)