>   (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.


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to