Are modules analogous to namespaces in C# or packages in Java?

bearophile bearophileHUGS at lycos.com
Wed Jan 1 11:01:38 PST 2014


Afshin:

> Can someone explain how to organize a set of classes into a 
> module (or namespace, or package) so that each class can have 
> their own file?

Lot of D code is not made of classes :-) There are also lot of 
free functions, some templates, some type definitions, some 
interfaces, some global constants or variables, module 
constructors, and more.

Often don't put a single class in each module. Generally you put 
related stuff in a single module.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list