emacs-devel
[Top][All Lists]
Advanced

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

eval-when-compile vs defconst


From: Bob Rogers
Subject: eval-when-compile vs defconst
Date: Sat, 11 Nov 2006 12:01:14 -0500

   From: Stephen Leake <address@hidden>
   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/




reply via email to

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