is `allMembers` useless for modules?

Atila Neves atila.neves at gmail.com
Mon Jan 14 14:06:02 UTC 2019


To answer the question in the title: no. I've written several 
libraries that make use of `allMembers` on modules.

On Monday, 14 January 2019 at 07:57:34 UTC, FeepingCreature wrote:
> It lists imported packages and modules, even though there's no 
> way to detect if a symbol is a module

Sure there is: `enum isModule(string moduleName) = 
is(typeof(mixin(`{ import `, moduleName, `; }`)))`

> and there's no way to go from the package to the modules it 
> contains.

This is true. There's currently no other way than listing modules 
to reflect on in a source file somewhere, but this can be 
automated.

> It does not list named imports at all, for basically no reason 
> I can tell.

I'm not sure what you mean by this.

> It's basically impossible at the moment to use templates to 
> navigate the import graph.

Ah. I'd use dmd as a library for this. I even started writing the 
code to do exactly this.





More information about the Digitalmars-d mailing list