What are modules for?

rickned nospam at nospam.net
Thu Nov 25 16:05:42 PST 2010


Modules, files, packages, compilation units...

I have a class that is designed to be derived from. Can I put it in
a module (file) so other people can import the module (file) like a
C-c++ header so they can derive from it? Is that the idomatic way
to do that in D? I don't want to expose the method definitions,
mind you. I understand deeply the C++ way of doing things like
hiding implementation and interfaces etc. Can someone bring it all
together for me in D? And note that the hiding part is not the gist
of my question, but rather that I want to understand the D way but
am probably trying to contrast it to the C++ way. I have TDPL
(borrowed from the library, and it's a one without Andy's name on
the cover), but I started reading it in the module chapter but
found it rather confusing, if not lacking all the pertinent info.


More information about the Digitalmars-d mailing list