[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

eval-when-compile vs defconst

From: Stephen Leake
Subject: eval-when-compile vs defconst
Date: Sat, 11 Nov 2006 09:39:32 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

I ran across this construct in ada-mode.el:

  (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.

But I'm not familiar with all of the nuances of byte-compiling, so I
thought I'd ask.

-- Stephe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]