On Wednesday, 6 November 2013 at 19:56:19 UTC, Dicebot wrote:
module aaa;
import std.string;
template Alias(alias S)
{
alias Alias = S;
}
void main()
{
import std.string;
foreach (symbol_name; __traits(allMembers, aaa))
{
alias symbol = Alias!(__traits(getMember, aaa, symbol_name));
static if (symbol.stringof.startsWith("module "))
{
}
else static if (symbol.stringof.startsWith("package "))
{
// recursion
}
}
}
Unfortunately this still suffers the same problem in that you
need a module symbol name to do anything. I need to get all
module symbols at compile time.