[pro] code organization and name conflicts
Scott L. Burson
Scott at sympoiesis.com
Wed Apr 13 19:10:26 UTC 2011
On Wed, Apr 13, 2011 at 11:35 AM, Ryan Davis <ryan at acceleration.net> wrote:
> When working on a larger lisp code base, one with 10+ files in one package,
> I begin to get nervous about accidental name conflicts, and was wondering
> how other people deal with this.
I used to work on some large Lisp systems in a place where standard
practice was often to let packages grow very large -- much larger than
10 source files -- and as I recall, name collisions occurred
remarkably rarely. And often when they did happen, the two functions
actually had the same or very similar contracts.
I think part of the reason for this was good naming practices. As a
general matter, the more specific the purpose of a routine, the longer
its name should be. If it's used only in one file, there should be at
least one word in its name that identifies it as related to the other
code in the file, such that that word is unlikely to appear in
unrelated code.
If that doesn't satisfy you, you're welcome to try my lexical contexts package:
http://common-lisp.net/cgi-bin/viewcvs.cgi/devel/src/contexts.text?rev=1.1&root=misc-extensions&view=markup
http://common-lisp.net/cgi-bin/viewcvs.cgi/devel/src/contexts.lisp?rev=1.1&root=misc-extensions&view=markup
I've found it handy on occasion, though I don't use it for everything
by any means.
-- Scott
More information about the pro
mailing list