Modules vs Packages
Giuseppe Bilotta
giuseppe.bilotta at gmail.com
Sat Sep 8 02:24:51 PDT 2007
Hello all,
as mentioned before, I'm a beginner at D but I just came across
another interesting limitation. I'm building this reliable
computing package, which would be composed by a number of modules
such as relcomp.ia for interval analysis and relcomp.aa for affine
arithmetic etc. Of course, in some cases it would make sense to
import all the package modules at once, so I my first thought was
to create a relcomp.d module which public-imported relcomp.ia,
relcomp.aa and whatever else.
This failed with the D frontend complaining that the relcomp
package and module had the same name. I must admit I was surprised
by this result. I'm probably misunderstanding the module
mechanism, but I see no reason why we couldn't have
package.d
package/module1.d
package/module2.d
etc, and be able to import package. The same could go on for
abitrary depth:
package.d
package/subpack.d
package/subpack/mod.d
to be imported as
import package;
or
import package.subpack
or
import package.subpack.mod
Why not?
--
Giuseppe "Oblomov" Bilotta
More information about the Digitalmars-d
mailing list