emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc-vars.el


From: Stefan Monnier
Subject: Re: cc-vars.el
Date: Wed, 20 Nov 2002 16:44:07 -0500

> > This way we could even add an "ignore pragmas" flag for
> > people who like to get all the warnings.
> [we can do this regardless]

I think you misunderstood: when people use tricks as is done in cc-bytecomp,
the byte-compiler has no clue what's going on and so you can't tell him to
ignore those hacks and give the warnings that they're trying to hide.
Whereas with well-defined pragmas like (defun foo), the byte-compiler
(meaning the user who byte-compiles a file ;-) can decide whether to
obey the pragmas or not.

> I know that in my own usage of fboundp checks, at least, is pretty limited
> to a small set of common pattersn like the ones I listed.  So are there some
> other uses that don't easily fit?  What are they?  

Agreed in general: supporting the (if (fboundp foo) bar baz) construct will
take care of some of the cases and will even cover a large part of the
cases, provided the code is rewritten to take advantage of it.

Cases it doesn't but can cover:

        (if (and (fboundp foo) bla) bar baz)

Cases it can't cover without adding harmful run-time checks:

        (if (fboundp 'make-extent)
            (let ((x (make-extent a b)))
              (set-extent-property x e f)))

By "harmful" I mean that not only the (fboundp 'set-extent-property) test
is wasting resources, but more importantly there's nothing else you can do
if it fails.

> It's not that I hate explicit pragmas with a passion or anything; if someone
> can get something past rms, I guess that's fine with me; but no one's
> presented much evidence in this thread that they're actually needed, and it'd
> be nice to see what things they _are_ needed for -- and anyway, we need that
> to design the pragmas anyway...  Did I miss something?

I don't think you missed anything.  I completely agree that we should
first concentrate on solution that don't require pragmas, especially
since it seems that they are more likely to be accepted by Richard.

Any objection to my little (featurep 'xemacs) hack and/or to Dave's
(if (fboundp ..) ..) patch ?


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]