From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: Is (provide 'foo) at the start good or bad? Date: Sun, 14 Jun 2009 12:30:16 -0700 (PDT) Message-ID: <51511.130.55.118.19.1245007816.squirrel@webmail.lanl.gov> References: <21glws7jx732.fsf@gmail.com> <87r5xqw0s8.fsf@uwakimon.sk.tsukuba.ac.jp> <49293.130.55.118.19.1244847603.squirrel@webmail.lanl.gov> <87eitowck5.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1245007838 4123 80.91.229.12 (14 Jun 2009 19:30:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jun 2009 19:30:38 +0000 (UTC) Cc: Leo , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 14 21:30:34 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MFvPW-00059d-DY for ged-emacs-devel@m.gmane.org; Sun, 14 Jun 2009 21:30:34 +0200 Original-Received: from localhost ([127.0.0.1]:39052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFvPV-0006s0-IR for ged-emacs-devel@m.gmane.org; Sun, 14 Jun 2009 15:30:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MFvPR-0006rG-73 for emacs-devel@gnu.org; Sun, 14 Jun 2009 15:30:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MFvPL-0006r1-Cf for emacs-devel@gnu.org; Sun, 14 Jun 2009 15:30:27 -0400 Original-Received: from [199.232.76.173] (port=57253 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFvPL-0006qy-83 for emacs-devel@gnu.org; Sun, 14 Jun 2009 15:30:23 -0400 Original-Received: from proofpoint2.lanl.gov ([204.121.3.26]:57613) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MFvPK-0007o3-P2 for emacs-devel@gnu.org; Sun, 14 Jun 2009 15:30:23 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint2.lanl.gov (8.14.3/8.14.3) with ESMTP id n5EJUGJb010969; Sun, 14 Jun 2009 13:30:16 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 9FB4D160248; Sun, 14 Jun 2009 13:30:16 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 8ABFE160236; Sun, 14 Jun 2009 13:30:16 -0600 (MDT) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 88C8A1518033; Sun, 14 Jun 2009 13:30:16 -0600 (MDT) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Sun, 14 Jun 2009 12:30:16 -0700 (PDT) In-Reply-To: <87eitowck5.fsf@uwakimon.sk.tsukuba.ac.jp> User-Agent: SquirrelMail/1.4.8-5.7.lanl1 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-06-13_02:2009-06-01, 2009-06-13, 2009-06-12 signatures=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111507 Archived-At: > > If you have two files which require each other, why do they each have a > > feature symbol? > > Because external packages don't know about the mutual dependency, and > shouldn't have to. Multiple versions of the files may support the > same interfaces, some with and some without mutual dependency. Etc. That was case #3, wasn't it? Once you have such a dependency, you might as well (internally, for development) treat the two files as one package. I didn't mean to imply that you never needed two symbols -- that's why I gave solutions, for each case that I could think of, that didn't involve putting `provide' at the top. > > Put differently, `provide' is supposed to "Announce that FEATURE is a > > feature of the current Emacs.". If you put it at the beginning of a > > package, you're lying (until the end of it). > > Sure. There are other standard techniques that involve such "lying", > like `(defvar foo)', which does exactly the same kind of thing that a > provide at the top does. In both cases, there may be a path through > the code leaves something uninitialized. But the only thing which can even tell that (defvar foo) was present is the byte-compiler; we know all about how to lie to it safely. `provide' has a globally-visible effect (that's its whole purpose!), so arbitrary code may react badly if we lie when we use it. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.