From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: run-hooks vs. run-mode-hooks.
Date: Fri, 27 May 2005 09:45:40 -0700 [thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICCEINCIAA.drew.adams@oracle.com> (raw)
In-Reply-To: <jwvvf548xjs.fsf-monnier+emacs@gnu.org>
> (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?
next prev parent reply other threads:[~2005-05-27 16:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 12:28 run-hooks vs. run-mode-hooks Lute Kamstra
2005-05-26 5:59 ` Richard Stallman
2005-05-27 0:58 ` Katsumi Yamaoka
2005-05-27 1:40 ` Lute Kamstra
2005-05-27 3:32 ` Katsumi Yamaoka
2005-05-27 8:01 ` Juanma Barranquero
2005-05-27 16:07 ` Stefan Monnier
2005-05-27 16:45 ` Drew Adams [this message]
2005-05-27 23:37 ` Juanma Barranquero
2005-05-27 14:20 ` Richard Stallman
2005-05-27 15:12 ` Lute Kamstra
2005-05-27 21:43 ` Miles Bader
2005-05-27 23:48 ` Katsumi Yamaoka
2005-05-30 6:45 ` Katsumi Yamaoka
2005-05-31 4:17 ` Richard Stallman
2005-05-28 11:52 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNEMKBNJBGPAOPIJOOICCEINCIAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).