Tuesday, June 30 2009 @ 00:00 +0200
The effects of DECLAIM are permitted to persist after the containing
file is compiled and it is unkind to mutate your user's settings.
Personally, I find DECLAIM too blunt and prefer to add declarations
within functions, even going as far as introducing LOCALLY subforms
just to have a place on which to hang declarations. But if you are
really set on using DECLAIM, please wrap it like this:
(eval-when (:compile-toplevel) (declaim (optimize speed)))
to ensure that the body is evaluated in the dynamic execution context of the compiler which makes a practical difference on Allegro. It goes
without saying that you don't want (PROCLAIM '(OPTIMIZE ...)) in a
library, either.