From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Is (provide 'foo) at the start good or bad? Date: Mon, 15 Jun 2009 12:04:44 +0900 Message-ID: <877hzeci43.fsf@uwakimon.sk.tsukuba.ac.jp> 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> <51511.130.55.118.19.1245007816.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245034982 28256 80.91.229.12 (15 Jun 2009 03:03:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jun 2009 03:03:02 +0000 (UTC) Cc: Leo , emacs-devel@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 15 05:02:58 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 1MG2TK-0002O6-AB for ged-emacs-devel@m.gmane.org; Mon, 15 Jun 2009 05:02:58 +0200 Original-Received: from localhost ([127.0.0.1]:53068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MG2TJ-0001Kg-Pa for ged-emacs-devel@m.gmane.org; Sun, 14 Jun 2009 23:02:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MG2TE-0001IM-Am for emacs-devel@gnu.org; Sun, 14 Jun 2009 23:02:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MG2T9-0001Fg-UJ for emacs-devel@gnu.org; Sun, 14 Jun 2009 23:02:52 -0400 Original-Received: from [199.232.76.173] (port=60347 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MG2T9-0001Fc-LT for emacs-devel@gnu.org; Sun, 14 Jun 2009 23:02:47 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:54478) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MG2T8-0002gB-NM for emacs-devel@gnu.org; Sun, 14 Jun 2009 23:02:47 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 553731537C0; Mon, 15 Jun 2009 12:02:38 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 53934120D66; Mon, 15 Jun 2009 12:04:45 +0900 (JST) In-Reply-To: <51511.130.55.118.19.1245007816.squirrel@webmail.lanl.gov> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" 5bbff3553494 XEmacs Lucid (x86_64-unknown-linux) 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:111514 Archived-At: Davis Herring writes: > > > 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? No. You're missing the "multiple versions" case. (Although GNU Emacs prefers to "support" 3rd party libraries by incorporating them, other Emacsen try to support third parties as independent projects, and that doesn't necessarily mean there's a blessed third party for each such library, either.) > Once you have such a dependency, you might as well (internally, for > development) You and I don't internally share a heart, and there's similarly no reason to suppose the libraries are jointly developed, not even the multiple versions of a single library. > > > 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. If you need to lie in programming, something is broken, and by definition that's not safe.