Re: Symbol clashes: how to avoid them. Part 2



On 2008-10-31, budden <budden01@xxxxxxxxxx> wrote:
Hi Group!

This topic originates from the following discussion:

You have overlooked one serious problem with USE-PACKAGE and its ilk.

Suppose that you are using two packages A and B, which happen to be
conflict-free.

The A package exports a function called FOO which you use by
its unqualified symbol.

Now a new version of both A and B comes out. It so happens that A:FOO is
removed from A (or no longer exported), and at the same time,
a new symbol B:FOO appears in B, also naming a function.

Your package use of A and B is still conflict-free. But now, your code
is calling the wrong FOO. No diagnostic is produced.

So you see, carelessly inheriting from multiple namespaces is dangerous and
stupid.

Handpicking symbols is the way to go, if you want to get it right, and in a way
that is future-proof.

(:shadowing-import-from :a :foo)

will blow up if FOO disappears from A. And it won't pick up any new symbols
that have appeared in a new revision of A.
.



Relevant Pages

  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... A path below the package level is generally a good means to shoot ... to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: A Question about DEFPACKAGE syntax
    ... Lisp and for not-really-Common-Lisp ... that it's easier to type:foo than to type "FOO". ... "FOO" does not create superficial symbols in the keyword package ...
    (comp.lang.lisp)
  • Re: Request for help constructing a simple macro
    ... Isn't an unbound symbol just a `symbol object'? ... Object in Lisp means generally all Lisp data. ... #:FOO ... No package for this symbol. ...
    (comp.lang.lisp)
  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... Unfortunately this is a side effect of using the os's directory structure to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: Best Practices - common code
    ... >> Let's say that we have a bunch of independent projects, among them Foo ... all of this common code ... > you can break up the bulk along package or package family* lines. ... > Ant can analyze class dependencies. ...
    (comp.lang.java.programmer)