TR: [cl-ppcre-devel] New release 1.2.4

Kick Damien-DKICK1 DKICK1 at motorola.com
Tue Mar 8 18:47:23 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.

Well, I suppose that something like the following might be a step in
the right direction.

    (defun f (x y) (+ x y))
    (defun g (x y z) (+ x y z))
    (locally (declare (optimize speed (safety 0) (debug 0)))
      (defun f* (x y)
        (declare (fixnum x y)
                 (values fixnum))
        (+ x y))
      (defun g* (x y z)
        (declare (fixnum x y z)
                 (values fixnum))
        (+ x y z)))

One still has to crank up Emacs to recompile with a different setting
but at least one can effect many defuns by making a change in one
place.  I suppose that one would have to do something like the
following to allow one to make such a change without having to use
Emacs.

    ;; keywords seem to be the easiest to "parse"
    (defmacro equivocally ((&whole values) &body forms) ...)
    (equivocally (:speed *cl-ppcre-speed-declaration-setting*
                  :debug *cl-ppcre-debug-declaration-setting*)
      (defun frobnicate (frob)
        (equivocate (optimize speed debug))
        (twiddle (this frob))))

EQUIVOCALLY would have to be a macro that would walk the code, looking
for EQUIVOCATE forms, substituting an equivalent DECLARE with the
values from the forms used in the EQUIVOCALLY form in place of the
EQUIVOCATE.

--
Damien Kick 



More information about the Cl-ppcre-devel mailing list