importing a symbol without specifying a subpackage name

Adam D. Ruppe destructionator at gmail.com
Wed Sep 16 13:33:34 UTC 2020


On Wednesday, 16 September 2020 at 13:30:57 UTC, 60rntogo wrote:
> I'm curious, how is this behavior achieved in the standard 
> library?

They define an additional file

std/package.d

(and std/algorithm/package.d btw)

that lists off

module std;

public import std.algorithm;
public import std.everything;
public import std.else;

you get the idea.

So then teh compiler sees import std and finds that package.d, 
then follows its public imports the rest of the way down.


More information about the Digitalmars-d-learn mailing list