[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval-when-compile vs defconst
From: |
Stephen Leake |
Subject: |
Re: eval-when-compile vs defconst |
Date: |
Sun, 12 Nov 2006 09:29:23 -0500 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) |
Richard Stallman <address@hidden> 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
- eval-when-compile vs defconst, Stephen Leake, 2006/11/11
- eval-when-compile vs defconst, Bob Rogers, 2006/11/11
- Re: eval-when-compile vs defconst, Richard Stallman, 2006/11/12
- Re: eval-when-compile vs defconst,
Stephen Leake <=
- Re: eval-when-compile vs defconst, Markus Triska, 2006/11/12
- Re: eval-when-compile vs defconst, Richard Stallman, 2006/11/13
- Re: eval-when-compile vs defconst, Stuart D. Herring, 2006/11/13
- Re: eval-when-compile vs defconst, Stefan Monnier, 2006/11/13
- Re: eval-when-compile vs defconst, Markus Triska, 2006/11/14
- Re: eval-when-compile vs defconst, Richard Stallman, 2006/11/14