[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

annoying compiler warnings again



Is there some way to keep the
TIME macro from complaining about undeclared free variables in a top-level
expression?  This is annoying because, among other things, it switches me
to the listener window from whatever buffer holds the TIME form, and makes
me have to read the error message and figure out why it should be ignored.

example:
? (setq test-text "Blah, blah, blah.")
"Blah, blah, blah."
? (char test-text 0)
#\B           ;;; great.  No compiler warnings, but...
? (time (char test-text 0))
;Compiler warnings :
;   Undeclared free variable TEST-TEXT, in an anonymous lambda form.
(CHAR TEST-TEXT 0) took ...
T

I can, of course, get around this with some verbose thing like
   (time (LET () (DECLARE (SPECIAL TEST-TEXT)) (char test-text 0)))
but this is gross to type when your just testing manually.
How about if MCL locally binds some compiler parameter around the form in the
macroexpansion of TIME to prohibit undeclared-free-variable warnings?

I could presumably implement my own TIME macro to do this, but it occurred to
me that enough other people might be interested in this fix that it would be
worthwhile to fix MCL itself.

-- Bob