Non-ugly ways to implement a 'static' class or namespace?

thebluepandabear therealbluepandabear at protonmail.com
Mon Jan 23 00:11:17 UTC 2023


On Sunday, 22 January 2023 at 18:30:59 UTC, ryuukk_ wrote:
> On Friday, 20 January 2023 at 11:28:23 UTC, thebluepandabear 
> wrote:
>
>
> D is not java/C#, it's better than that!
>
>
> ```D
>
> // api.d
>
> void draw(){}
>
>
> // app.d
>
> import API = api;
>
>
> void main()
> {
>     API.draw();
> }
>
> ```

Sorry don't like that solution specifically. That's because it is 
a procedural implementation, not an OOP-style one. I don't know 
how much of the D community writes procedurally but I'm 
personally an OOP-type of guy.


More information about the Digitalmars-d-learn mailing list