warn if not top-level?



I have a macro RUN-TESTS that runs test code. (Tests
are defined with DEFINE-TEST.) To support tests on macros,
test code is stored uncompiled and assembled when RUN-TESTS
is expanded.

I would like to warn users that code like

(DEFUN MY-TESTS () (RUN-TESTS ...))

may be a mistake, since the code saved in MY-TESTS will
no longer be updated when tests are updated or macros
are redefined.

Is there any portable way to recognize the above situation?

Or should I change RUN-TESTS to expand into code that
collects code at run-time and calls EVAL?
.



Relevant Pages