How to import & export modules
Arun Chandrasekaran
aruncxy at gmail.com
Mon Nov 11 06:01:09 UTC 2019
On Monday, 11 November 2019 at 01:28:54 UTC, userTY wrote:
> On Sunday, 10 November 2019 at 23:53:22 UTC, Vinod K Chandran
> wrote:
>> [...]
>
> You must use a module that has public imports.
> Public imports are visible from the module that contain them
> but most importantly from the module that imports the module
> containing the public imports.
>
> ---
> module all;
>
> public import App, Form, Button;
> ---
>
> ---
> module app;
>
> import all; // can see App, Form and Button exported (public)
> symbols
> ---
>
> See the specifications [1] for more comprehenssive details.
>
> [1]: https://dlang.org/spec/module.html#public_imports
Just a nitpick, prefer to use D style:
https://dlang.org/dstyle.html
Modules are essentially files. So keeping them lower case makes
it easier.
More information about the Digitalmars-d-learn
mailing list