Actually, on the second tought, best one can do with 'shallow' packages is
to divide total of n names into sqr(n) packages of sqr(n) names, with name
collision problem reoccurring in each of the packages and between them.
With deeply nested packages, there would be no collision, but reference of
the global would require many prefixes separated with "::": (for binary
tree hierarchy log2(n) of them), and many new package names. Every package
solution is between those two extremes; either there is too many (possibly
duplicated) names in packages and library or too many prefixes. Note also
that good organization of the hierarchy is very ambitious pursuit, even if
lot is known (see Britannica Propaedia); if future development of the
library is unpredictable, yet backward compatibility needs to be preserved,
it cannot succeed. Packages implementation problems (I see only name
leaking from imported (and inner) packages toward used but undeclared
locals in users program) can be added on top, but it is less important.
Even with packages, one can apply unique names (and solve mentioned
problems), but then packages only complicate things. Without intention to
be disrespectful - obviously serious work is done on packages
implementation -- I think it would be wise not to include them in the first
release distribution, it will procrastinate satisfactory solution and
require further maintenance. It is not irreparable harm, any case,
impossibility of the name collision and free mixing of any two parts of
library (even without link/import, theoretically, linker can find unique
names on his own) suggest unique name as more promising approach.
----
Kazimir Majorinc, Zagreb, Croatia
- [Unicon-group] Proposal of naming conventions in IPL Kazimir
- Re: [Unicon-group] Proposal of naming conventions i... Steve Wampler
- Re: [Unicon-group] Proposal of naming conventio... Kostas Oikonomou
- Re: [Unicon-group] Proposal of naming conve... Majorinc, Kazimir
- RE: [Unicon-group] Proposal of naming conventio... Majorinc, Kazimir
