[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: run-hooks vs. run-mode-hooks.
From: |
Drew Adams |
Subject: |
RE: run-hooks vs. run-mode-hooks. |
Date: |
Fri, 27 May 2005 09:45:40 -0700 |
> (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?
- run-hooks vs. run-mode-hooks., Lute Kamstra, 2005/05/25
- Re: run-hooks vs. run-mode-hooks., Richard Stallman, 2005/05/26
- Re: run-hooks vs. run-mode-hooks., Katsumi Yamaoka, 2005/05/26
- Re: run-hooks vs. run-mode-hooks., Lute Kamstra, 2005/05/26
- Re: run-hooks vs. run-mode-hooks., Katsumi Yamaoka, 2005/05/26
- Re: run-hooks vs. run-mode-hooks., Juanma Barranquero, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Stefan Monnier, 2005/05/27
- RE: run-hooks vs. run-mode-hooks.,
Drew Adams <=
- Re: run-hooks vs. run-mode-hooks., Juanma Barranquero, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Richard Stallman, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Lute Kamstra, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Miles Bader, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Katsumi Yamaoka, 2005/05/27
- Re: run-hooks vs. run-mode-hooks., Katsumi Yamaoka, 2005/05/30
- Re: run-hooks vs. run-mode-hooks., Richard Stallman, 2005/05/31
- Re: run-hooks vs. run-mode-hooks., Richard Stallman, 2005/05/28