[Top][All Lists]

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

Re: Is (provide 'foo) at the start good or bad?

From: Stephen J. Turnbull
Subject: Re: Is (provide 'foo) at the start good or bad?
Date: Sat, 13 Jun 2009 21:19:54 +0900

Davis Herring writes:

 > > Putting the provide form at the beginning allows mutually recursive
 > > requires to succeed.
 > 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.

 > 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.

reply via email to

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