[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: featurep instead of bound tests
From: |
Stephen J. Turnbull |
Subject: |
Re: featurep instead of bound tests |
Date: |
Fri, 25 Jan 2008 18:45:24 +0900 |
Dan Nicolaescu writes:
> Stefan Monnier writes:
> > Agreed. I see 2 better solutions:
> > 1 - use (require 'outline)
I have no opinion on that, but
> > 2 - teach the byte-optimizer that (fboundp 'make-overlay) will
> > always be t.
is not useful.
(fboundp 'make-overlay) is always the wrong thing to do (unless the
code gracefully exits, doing nothing, without it). XEmacs *does* have
`make-overlay' (it's deprecated and not autoloaded or dumped, but it
exists in a compatibility library that can be require'd). I imagine
there are some people who have emulated `make-extent' with
`make-overlay' for Emacs, too.
However, emulations are rarely perfect (XEmacs's `make-overlay' is
explicitly not intended to be), so many developers are going to wish
to use the native facilities. That *requires* a (featurep 'xemacs) or
equivalent to know which is native when both are fboundp.
> [Optimizing (fboundp 'make-overlay)] has the problem that XEmacs
> would have to teach its compiler that it is always false.
No, that's not a problem. The compiler doesn't need to know, it's an
optimization. In any case, it's not always false in XEmacs.