TR: [cl-ppcre-devel] New release 1.2.4
Kick Damien-DKICK1
DKICK1 at motorola.com
Tue Mar 8 19:17:41 UTC 2005
Edi Weitz [edi at agharta.de] wrote:
> On Tue, 8 Mar 2005 10:52:47 -0600, Kick Damien-DKICK1
> <DKICK1 at motorola.com> wrote:
>
> > Personally, I still would like to know of an easy way to change
> > these settings.
>
> Me too. If there's a simple idiom for this I'll be happy to
> incorporate it into CL-PPCRE.
Silly Damien, RTFM. There was a X3J13 issue
<http://tinyurl.com/6mw2d> in which the ability to write macros that
expanded into declaration forms was removed. The discussion of the
issue includes examples of how to acheive the wanted affect. For the
moment, the following is my favorite:
Another tactic would be:
Old code: (EVAL-WHEN (EVAL COMPILE LOAD)
(DEFVAR *SPEEDY* NIL))
(DEFMACRO USE-STANDARD-SPEED-AND-SAFETY ()
(IF *SPEEDY*
`(DECLARE (OPTIMIZE (SPEED 3) (SAFETY 0)))
`(DECLARE (OPTIMIZE (SPEED 0) (SAFETY 3)))))
(DEFUN FOO ()
(USE-STANDARD-SPEED-AND-SAFETY)
...)
New code: (EVAL-WHEN (EVAL COMPILE LOAD)
(DEFVAR *STANDARD-SPEED-AND-SAFETY*
'((SPEED 0) (SAFETY 3))))
(DEFUN FOO ()
(DECLARE (OPTIMIZE #.*STANDARD-SPEED-AND-SAFETY*))
...)
--
Damien Kick
More information about the Cl-ppcre-devel
mailing list