From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: eval-when-compile vs defconst Date: Sun, 12 Nov 2006 09:29:23 -0500 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1163341796 31837 80.91.229.2 (12 Nov 2006 14:29:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Nov 2006 14:29:56 +0000 (UTC) Cc: Stephen Leake , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 12 15:29:54 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 1GjGLJ-0005yh-PV for ged-emacs-devel@m.gmane.org; Sun, 12 Nov 2006 15:29:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjGLI-0002C7-TJ for ged-emacs-devel@m.gmane.org; Sun, 12 Nov 2006 09:29:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjGL6-0002Bp-T2 for emacs-devel@gnu.org; Sun, 12 Nov 2006 09:29:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjGL1-0002BH-U3 for emacs-devel@gnu.org; Sun, 12 Nov 2006 09:29:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjGL1-0002BC-Qx for emacs-devel@gnu.org; Sun, 12 Nov 2006 09:29:35 -0500 Original-Received: from [207.172.157.102] (helo=smtp02.lnh.mail.rcn.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GjGKz-0002qw-Rf; Sun, 12 Nov 2006 09:29:33 -0500 Original-Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 12 Nov 2006 09:29:34 -0500 Original-Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.7.5a-GA) with ESMTP id MMY84034; Sun, 12 Nov 2006 09:29:31 -0500 (EST) Original-Received: from 208-59-165-113.c3-0.slvr-ubr1.lnh-slvr.md.cable.rcn.com (HELO ACS1100007992) ([208.59.165.113]) by smtp01.lnh.mail.rcn.net with ESMTP; 12 Nov 2006 09:29:32 -0500 X-IronPort-AV: i="4.09,414,1157342400"; d="scan'208"; a="310456436:sNHT24506048" Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sun, 12 Nov 2006 00:14:40 -0500") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) X-Junkmail-Status: score=10/50, host=mr02.lnh.mail.rcn.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090209.45572F39.001F,ss=1,fgs=0, ip=207.172.4.11, so=2006-05-09 23:27:51, dmn=5.2.121/2006-09-27 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:62118 Archived-At: Richard Stallman writes: > 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; > > No, you may as well define that variable in all cases. Ok, thanks. Now, how about this form: (defvar ada-block-start-re (eval-when-compile (concat "\\<\\(" (regexp-opt '("begin" "declare" "else" "exception" "generic" "loop" "or" "private" "select" )) "\\|\\(\\(limited\\|abstract\\|tagged\\)[ \t\n]+\\)*record\\)\\>")) "Regexp for keywords starting Ada blocks.") Is the `eval-when-compile' useful here? I'm thinking it is. The help for `defvar' says initvalue is evaluated, but it's not clear whether that happens at compile time or load time. -- -- Stephe