lua-users home
lua-l archive

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


Quoth KHMan <keinhong@gmail.com>, on 2010-11-20 09:36:14 +0800:
> Even if two libraries are a teeny bit different, sharing a set of
> names is no biggie.

The main reason this fails is recursive dependencies.  If library A
uses bit manipulation and requires semantics X, and library B uses bit
manipulation and requires incompatible semantics Y, where do they get
their bit modules?  If the answer is that they both get them from the
global named "bit", which can only have one value, using libraries A
and B in the same project becomes a nightmare for no particular
reason.

(This is why some language environments use long names with more
worldly delegation semantics, then provide for short aliases.  Often
they're partitioned by "vendor" so that one naming-entity (person or
organization) only has to manage collisions with other naming-entities
and collisions with their own names, and similar but incompatible
functionality from two different sources is readily disambiguable.)

> We're not likely to get confused once we pick
> one to use, either statically or dynamically. If we want to use both
> at the same time, then we'd better know what we are doing eh...

You're not using both at the same time in the same code; you're using
one piece of code that uses one, and another piece of code that uses
the other, and both are individually quite nice but the reliance on a
shared namespace causes a collision.

   ---> Drake Wilson