The patch implements the proposed behavior for ASSERT. Tests are included.

I originally used (CONSTANTP PLACE ENV) but i had to take ENV out because otherwise the build failed. Presumably it happened due to early use of ASSERT.

During tests of the patch, i encountered an error in float.pure.lisp in the expression (assert (typep (nth-value 1 (ignore-errors (float-radix "notfloat"))) 'type-error)): the subexpression (nth-value ...) seems to return NIL. My macro expansion is here: http://paste.lisp.org/display/136940 . Am I doing something wrong? or is it a bug in IGNORE-ERRORS?

To answer the question regarding the new type failure: it's very unlikely to be a bug in IGNORE-ERRORS. Does the evaluation of subforms in your evaluator handle multiple values correctly? (Another possibility that I seem to remember seeing fly past on IRC somewhere was that the error handling in FLOAT-RADIX is not quite right, but that is based on possibly faulty memory).

Could you update the patch to HEAD? There'll be a conflict in the change to NEWS, I'm afraid. Thanks.

I think we should try and avoid duplicating temporary argument forms in the expansion. Currently, forms are copied for the initial and the step form in DO, and that's not good for compile times… especially when ASSERTs are nested (e.g. via inlining).

That'll probably be most easily achieved with TAGBODY.

Re CONSTANTP, you probably need to use the cross-compiler's version (sb!xc:constantp).

The test failure is likely caused by the use of assignment: the compiler
does a much better job on purely-functional code, especially for unboxed
values. I'm not sure why intermediate values are computed with a LET
binding around the loop and SETF. Moving the LET bindings inside the
loop should fix that unexpected consing.