Find symbol in unknown module at compile time?
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Sat Dec 6 17:22:02 PST 2014
On Sun, 07 Dec 2014 01:12:52 +0000
bitwise via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> If the reflection mixin is in the same module that it's
> reflecting, it can be easily found, but in the case of a static
> library where reflection information has to be created in a
> separate module, other modules won't be able to locate the
> reflection.
why don't create a dummy module which only keeps list of all known
objects, and create `shared static this ()` constructors which will
just register everything in that module?
in compile-time other modules can inspect things with traits, and in
run-time you'll have one central place with all known metadata, and
with autoregistration. and it's doesn't matter where you call your
metadata generation mixin, all data will end registered in one place.
-------------- 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/20141207/93dd3bdf/attachment.sig>
More information about the Digitalmars-d
mailing list