From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: cc-vars.el Date: Wed, 20 Nov 2002 16:44:07 -0500 Sender: emacs-devel-admin@gnu.org Message-ID: <200211202144.gAKLi7123318@rum.cs.yale.edu> References: <200211180057.JAA24537@etlken.m17n.org> <5bbs4m8qz9.fsf@lister.roxen.com> <5bwun97ecw.fsf@lister.roxen.com> <20021119165749.GA27657@gnu.org> <5b65utkyqt.fsf@lister.roxen.com> <200211201358.gAKDwsG21304@rum.cs.yale.edu> <20021120212939.GA29543@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037829053 4848 80.91.224.249 (20 Nov 2002 21:50:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2002 21:50:53 +0000 (UTC) Cc: Martin Stjernholm , Dave Love , Kenichi Handa , rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18EckA-0001FU-00 for ; Wed, 20 Nov 2002 22:50:46 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18EcnX-0001hW-00 for ; Wed, 20 Nov 2002 22:54:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Ecfn-0000lP-00; Wed, 20 Nov 2002 16:46:15 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18Ecdx-0007lj-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 16:44:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18Ecdr-0007T1-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 16:44:20 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Ecdk-0007Dz-00; Wed, 20 Nov 2002 16:44:08 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id gAKLi7123318; Wed, 20 Nov 2002 16:44:07 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Miles Bader Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9582 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9582 > > 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