Explain the Modules to me but better...

Modules Confuse Me via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 29 10:20:22 PST 2016


I'm trying to get going with D, but I keep getting hung up on 
modules. I personally like having many smaller files. Generally 
classes and interfaces all go into their own file. Even if the 
overall file ends up being smaller than 10 lines of real code.

After reading:

https://dlang.org/spec/module.html

I seem to have at least enough information to get things working, 
but things break down after I start trying to package everything 
up into packages. Because it's a pain in the butt to have to 
include my interface files in separate imports than the 
implemented classes. So, I see D has packages, but whenever I use 
them I start getting errors like:

Error: linker exited with status 180314872

I'm really getting hung up on a simple thing, such as how to 
structure my program in the 'D' way. So correct me if I am wrong. 
In my packages, I should be using 'public' imports correct? So 
that the imports get forwarded. I'm looking through phobos, to 
try to get a good idea of how others do it, and I don't see 
myself doing things too differently...


More information about the Digitalmars-d-learn mailing list