On Friday, 20 January 2023 at 13:38:47 UTC, evilrat wrote:
On Friday, 20 January 2023 at 13:17:05 UTC, Ruby The Roobster ...
[snip]

Also there is various import options such as renamed import or static import(doesn't add module to a scope thus requiring to fully qualify it)

static import, can be used to somewhat mimic namespaces, more complex scenario would be making a module consisting of public imports to group things together, but I don't think it is common in D.
https://dlang.org/spec/module.html#static_imports

```d
static import std.stdio;

void main()
{
  // nope, this function will not be resolved, compilation error
  // wrtiteln("hello");

  // ok
  std.stdio.writeln("hello");
}
```

I never knew that there even WAS a `static import` option. Good to know.

Reply via email to