Inline Module / Namespace

Jonathan JonathanILevi at gmail.com
Fri Mar 9 18:44:07 UTC 2018


D kinda lacks a way of creating a module/namespace inside another 
file.

D does have modules but they have to be in separate files.  
(Though separate files may be better coding practice, why is it 
D's job to tell me how to code.)

I think a simple way to do this with existing syntax is to add 
functionality for `module` to be used as a block.


     module modulename {
         void fun(){}
     }
     modulename.fun();


An inline module.


More information about the Digitalmars-d mailing list