Pseudo namespaces

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 3 13:46:03 PST 2015


On Thu, 03 Dec 2015 21:02:07 +0000, Dicebot wrote:

> And for that specific "stable" example - just make it a separate module,
> problem solved. To make use of module system for symbol resolution one
> needs to have many small modules, _that_ should become D idiom.

Usually the right answer, but then you get into circular dependency 
problems sometimes. You can fix circular dependency issues with deferred 
initialization, but that can muck up your API. You can fix them by moving 
static initialization into its own module, but that requires people to 
import the static initialization module.

So maybe explicit namespaces within a module are justified sometimes.


More information about the Digitalmars-d mailing list