[Top][All Lists]

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

Re: eval-when-compile vs defconst

From: Stuart D. Herring
Subject: Re: eval-when-compile vs defconst
Date: Mon, 13 Nov 2006 10:41:25 -0800 (PST)
User-agent: SquirrelMail/1.4.6-7.el3.7lanl

>     (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.")
> It would not be worth any extra complexity just to avoid one call to
> concat when the file is loaded.  So even if eval-when-compile were not
> a no-op here, I'd say take it out.

Surely it's there to avoid calling (and loading) `regexp-opt' at load
time, and the concat is merely along for the ride?  Unless the optimizer
already evaluates calls to `regexp-opt' on quoted lists, it seems useful
to me.


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

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