Inline Module / Namespace
Manu
turkeyman at gmail.com
Fri Mar 9 18:51:50 UTC 2018
On 9 March 2018 at 10:44, Jonathan via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> 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.
If you tried to `import modulename;` from some other module... how
would the compiler know where to find it?
More information about the Digitalmars-d
mailing list