Unless you were looking for something to actually change Lisp-level calls to (error 'type-error ...) into the primitive trap *whenever* it is possible to do so, that's far more ambitious, and moreover "interr.lisp" is going to have to be informed not to do that because it's trying to convert the trap into really a Lisp error. Maybe just a (notinline error) declaration would suffice.
Mostly resolved by https:/ /sourceforge. net/p/sbcl/ sbcl/ci/ 87318119bd57b89 3a6dce02009b805 14cf2c2caa/ NOT-FUN- ERROR is named inconsistently with my simplistic approach)
I'm missing some transformations but I think those can be added with relative ease.
(e.g. 'FUNCTION -> OBJECT-
Unless you were looking for something to actually change Lisp-level calls to (error 'type-error ...) into the primitive trap *whenever* it is possible to do so, that's far more ambitious, and moreover "interr.lisp" is going to have to be informed not to do that because it's trying to convert the trap into really a Lisp error. Maybe just a (notinline error) declaration would suffice.