> (if (fboundp 'function-in-doubt)
> (defalias 'mymodule-function-in-doubt 'function-in-doubt)
> (defun mymodule-function-in-doubt ...))
Actually this form has the disadvantage that the
byte-compiler would have to check which functions
are defnied in every branch. And snice it doesn't
do that as of now, the byte-compiler won't noticve
that this form does define
`mymodule-function-in-doubt' and will hencforth
issue warnings when you call that function.
Better use:
(defalias 'mymodule-function-in-doubt
(if (fboundp 'function-in-doubt)
'function-in-doubt
(lambda (..) ...)))
which makes it trivially obvious that `mymodule-function-in-doubt' will
indeed always be defined.
Is the behavior of the byte-compiler for this kind of thing explained
somewhere? That is, are there coding guidelines somewhere to guide Lisp
users wrt the byte compiler?
_______________________________________________
Emacs-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-devel