emacs-devel
[Top][All Lists]
Advanced

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

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


From: Davis Herring
Subject: Re: Is (provide 'foo) at the start good or bad?
Date: Fri, 12 Jun 2009 16:00:03 -0700 (PDT)
User-agent: SquirrelMail/1.4.8-5.7.lanl1

> 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?  Requiring one is equivalent to requiring the other (and
equivalent to requiring both, in either order), and `featurep' will always
return the same value for each.  The only reasons I can think of to have
two such files separately are to
1. make them each smaller and easier to digest
2. hide some ugly hacks that aren't relevant to the package's interface
3. provide backwards compatibility with earlier versions of two packages
that used to not be interdependent
4. connect two packages which somehow depend on each other and yet are
maintained by different people.

#1 and #2 can be resolved by having the one that is found by `require'
`load' the other.  #3 can be resolved by replacing one or both "old"
packages with a "dummy" that merely requires the combined package and
provides itself.  #4 is likely to require more than merely turning the
third `require' into a no-op: putting one of the `require's at the bottom,
or doing something like (let ((combined-a-b-load t)) (require 'b)).

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

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.




reply via email to

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