Re: defvar'ing constants
Stephen J. Turnbull <stephen <at> xemacs.org>
2005-08-01 01:39:29 GMT
Sorry this is old; getting back into emacs-devel after a long hiatus.
>>>>> "Jay" == Jay Belanger <belanger <at> truman.edu> writes:
Jay> That would be nice. A while back, there was a discussion
Jay> along the lines of doing something similar for functions,
Jay> (defun foo) to keep the compiler happy. I recall the idea
Jay> (not mine) meeting approval. Perhaps it's still planned for
Jay> a future release?
XEmacs has a whole suite of macros for checking whether things are
boundp or fboundp, and for locally declaring them to be f?boundp to
the compiler without using def* macros. We have found them very
useful in suppressing spurious compiler warnings. If there is
interest in using this code, they are not yet assigned to the FSF, but
at the present time they are 100% written by Ben Wing <ben <at> xemacs.org>
as far as I know. You might ask Ben to assign the code and avoid
redundant work on this.
The only advantage I see over the (defvar foo) approach is that you
avoid spurious tags, but this can be convenient.
These macros do not require any changes to the byte-compiler (in
XEmacs, anyway), and can even be placed in a separate library and
require'd only in the files where they are used. (I don't recommend
this, just demonstrating that they don't interfere with the normal byte
compiler.)
Cheers,
(Continue reading)