Would it be possible to have a warning or note issued when a declaration is overridden due to the policy?  Many a head-scratching debugging has resulted when a global setting overrides a local one.  My experience with emacs programming for example is that I set a variable I think does what I want, and there is absolutely no effect because of some global setting I didn't realize took precedence. 

On 6/29/07, Nikodemus Siivola <nikodemus@random-state.net> wrote:
Nikodemus Siivola wrote:
> I have a patch that implements a way to globally restrict
> policicies in SBCL:
>   (restrict-compile-policy 'safety 1)
> will override any local declarations or global proclamations
> of SAFETY 0.


  http://random-state.net/tmp/policy.patch RESTRICT-COMPILER-POLICY

  * Allow users to set a global minimum for optimization qualities,
    overriding declarations and proclamations.

    The intended use is to make it easy to recompile large bodies of
    code with many local optimization declarations with a minimum
    SAFETY or DEBUG everywhere.

  * Delete some unused functions: READ-SEQUENCE-OR-DIE,

  * Changes to SBCL itself to allow building with SBCL that has minimum
    safety set to 3:

     -- Second argument of %MORE-KW-ARG is a negative: DEFKNOWN it as a
        FIXNUM, not INDEX.

     -- We don't have a deftype for SB-VM::POSITIVE-FIXNUM -- it's only
        a backend type. Use (AND UNSIGNED-BYTE FIXNUM) instead.

I'll merge this soonish absent any cries of horror.


  -- Nikodemus

This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Sbcl-devel mailing list