How to get all modules in a package at CT?
mw
mw at g.c
Thu Oct 5 22:32:36 UTC 2023
On Thursday, 5 October 2023 at 21:25:54 UTC, cc wrote:
>>
>> So how about at runtime? I just want the compiler to help to
>> list them, instead of doing manually.
>
> At runtime, simply:
> ```d
> foreach (m; ModuleInfo) {
> writeln(m.name);
> }
> ```
>
> However, Walter has hinted that he wants to remove ModuleInfo
> at some point.
So ModuleInfo contains all the modules (transitive closure) built
into the current binary that is running?
Is there document about this ModuleInfo?
I only find Struct object.ModuleInfo
https://dlang.org/library/object/module_info.html
Which seems different.
More information about the Digitalmars-d-learn
mailing list