October 14, 2014 Re: allMembers trait for module | ||||
|---|---|---|---|---|
| ||||
Attachments: | On Tue, 14 Oct 2014 13:10:23 +0300
ketmar via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
mkay, mkay, we have an easy solution to sort out "non-module" symbols:
enum isModuleMember(alias mod, alias id) =
is(typeof(__traits(getMember, mod, id)));
string listit(alias mod) () {
foreach (m; __traits(allMembers, mod)) {
static if (isModuleMember!(mod, m)) {
pragma(msg, m);
}
}
return "";
}
but i still want to know the specie of the alien! bounty of Great Nothing to the brave person who will do reliable isModuleSymbol (isModuleSymbol!mod == true) and isVersionSymbol (i bet you can't do that without nasty hacks! actually, i'm not sure if it's even doable).
our CTFE Lisp implementation still not lispy enough...
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply