Hi!
I need to iterate module members and find specific classes (and
make tuple).
class foo{};
pragma (msg, __traits(allMembers,mixin(__MODULE__)));
gives me empty tuple. I found also this thread from 2011:
http://forum.dlang.org/post/mailman.325.1293887146.4748.digitalmars-d-learn puremagic.com
This is exactly what I need but this code also gives empty tuple.
Is this possible for now to iterate classes from module? Is this
possible to iterate by classes, public imported to module? (in
fact, I need to iterate classes imported using package.d file).

Hi!
I need to iterate module members and find specific classes (and
make tuple).
class foo{};
pragma (msg, __traits(allMembers,mixin(__MODULE__)));
gives me empty tuple. I found also this thread from 2011:
http://forum.dlang.org/post/mailman.325.1293887146.4748.digitalmars-d-learn puremagic.com
This is exactly what I need but this code also gives empty
tuple.
Is this possible for now to iterate classes from module? Is
this possible to iterate by classes, public imported to module?
(in fact, I need to iterate classes imported using package.d
file).

it doesn't matter. if there is no explicit module declaration,
compiler will insert implicit one. from the code PoV, there is
no difference at all.

Yes, module statement is no reason. package.d is reason. The
same code in two files:
class foo{};
struct bar{};
pragma (msg, "allMembers of "~__MODULE__~" in "~__FILE__);
pragma(msg, __traits(allMembers, mixin(__MODULE__)));
Result:
allMembers of vcm.bll.event in source/vcm/bll/event/package.d
tuple()
allMembers of vcm.bll.event.test in source/vcm/bll/event/test.d
tuple("object", "vcm", "foo", "bar")
So allMembers gives empty tuple for module in package.d file.
Please check it. As I understand documentation, package.d is
ordinary module and special here is only file name used when
module name is directory.
DMD 2.071.1. Is this a bug or documentation problem?

well, it's hard to say. package.d is one of the cases where you
*have* to provide explicit module definition. ;-) 'cause implicit
one creates module with name `package`, which is teh keyword. and
then all the hell broke loose. this actually may be both bug and
documentation problem.

well, it's hard to say. package.d is one of the cases where you
*have* to provide explicit module definition. ;-) 'cause
implicit one creates module with name `package`, which is teh
keyword. and then all the hell broke loose. this actually may
be both bug and documentation problem.