Import all?

Jonathan M Davis jmdavisProg at gmx.com
Thu Jul 18 16:14:28 PDT 2013


On Thursday, July 18, 2013 23:53:53 JS wrote:
> On Thursday, 18 July 2013 at 19:35:15 UTC, Jonathan M Davis wrote:
> > On Thursday, July 18, 2013 11:38:41 JS wrote:
> >> Essentially all emulates the package.d, and I like it because
> >> it's descriptive and easily maintainable... thats all I was
> >> after
> >> in the first place. Too bad package doesn't work properly ;/
> > 
> > Do you mean the package attribute or package.d? package.d
> > should work just
> > fine. I'm not aware of any outstanding bugs with it. The
> > attribute is still
> > broken though, I believe.
> > 
> > - Jonathan M Davis
> 
> When I used package.d things didn't work out like they do using
> all. It may be due to bugs on my end(I had a few typos). Maybe I
> will try it again though(simple rename and remove .all).

Well, what you were posting was wrong, and I believe that I pointed out why. A 
package.d file's module declaration needs to have the same name as the package. 
So, if you have

abc/foo/package.d

then package.d needs

module abc.foo;

for its module declaration. Then you import the package as if it were a 
module, so you get any public imports which were in it. But as I said before, 
this won't work for the top level, because the top level isn't a package. You 
need a sub-folder to have a package.

- Jonathan m Davis


More information about the Digitalmars-d-learn mailing list