How to undo a `declaration` proclamation?

Viewed 165

It appears that most (if not all) global declarations cannot be reverted in an ANSI CL standard way.

E.g., once you evaluate (either directly or by loading a file) a form like (proclaim '(declaration my-decl)) or (declaim (special *my-var*)) there is no portable way to make (declare (my-decl ...)) illegal or *my-var* lexical.

Various implementation offer non-portable way to revert the special declaration, usually via (proclaim '(notspecial *my-var*)) or some other trick.

How about the declaration proclamation?

How do various implementations undo it? How would you implement it? Do you think (proclaim '(notdeclaration my-decl)) is a good idea?

Motivation: in a test suite, it would be nice to be modular - to be able to revert all effects of a test statements to avoid any possible interference with test suite parts. I know it's a week motivation because The Right Way is to use packages.

1 Answers
Related