allMembers trait for module

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 14 03:59:51 PDT 2014


On Tue, 14 Oct 2014 13:10:23 +0300
ketmar via Digitalmars-d <digitalmars-d at 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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141014/62b37be8/attachment.sig>


More information about the Digitalmars-d mailing list