From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: eval-when-compile vs defconst Date: Sat, 11 Nov 2006 12:01:14 -0500 Message-ID: <17750.474.277857.851065@rgrjr.dyndns.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163264702 19739 80.91.229.2 (11 Nov 2006 17:05:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 11 Nov 2006 17:05:02 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 11 18:05:00 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GiwHi-0002FF-CO for ged-emacs-devel@m.gmane.org; Sat, 11 Nov 2006 18:04:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiwHh-0005LG-Tc for ged-emacs-devel@m.gmane.org; Sat, 11 Nov 2006 12:04:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GiwEK-00044Z-JZ for emacs-devel@gnu.org; Sat, 11 Nov 2006 12:01:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GiwEI-00043x-LV for emacs-devel@gnu.org; Sat, 11 Nov 2006 12:01:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiwEF-00043p-Ku for emacs-devel@gnu.org; Sat, 11 Nov 2006 12:01:15 -0500 Original-Received: from [24.128.218.106] (helo=rgrjr.dyndns.org) by monty-python.gnu.org with smtp (Exim 4.52) id 1GiwEF-0001wi-5h for emacs-devel@gnu.org; Sat, 11 Nov 2006 12:01:15 -0500 Original-Received: (qmail 10350 invoked by uid 500); 11 Nov 2006 17:01:14 -0000 Original-To: Stephen Leake In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.0.90.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62076 Archived-At: From: Stephen Leake Date: Sat, 11 Nov 2006 09:39:32 -0500 I ran across this construct in ada-mode.el: (eval-when-compile (defconst ada-95-string-keywords '("abstract" "aliased" "protected" "requeue" "tagged" "until") "List of keywords new in Ada 95. Used to define `ada-*-keywords'.")) Is there any point to the 'eval-when-compile'? Help for eval-when-compile says; Like `progn', but evaluates the body at compile time if you're compiling. Thus, the result of the body appears to the compiler as a quoted constant. In interpreted code, this is entirely equivalent to `progn'. Since the body is already a quoted constant, this seems redundant. I suspect the eval-when-compile is left over from a previous version when functions where used to build the string. It says "the _result_ of the body", i.e. after compile-time evaluation. -- Bob Rogers http://rgrjr.dyndns.org/