Time for std.reflection

Jonathan M Davis jmdavisProg at gmx.com
Sat Jul 21 20:46:50 PDT 2012


On Sunday, July 22, 2012 05:19:39 Kapps wrote:
> What I meant was that when something requires reflection, it
> generally requires that everything it contains has reflection
> information as well. If using a mixin directly in the module
> itself, when a module does not include this mixin it will never
> get reflection information. This may or may not be desired.
> However it completely prevents many common uses of reflection,
> including serialization. So long as there is any dependency on
> any type or method that does not have reflection info, the entire
> operation would fail. This means that people will either start
> adding reflection to modules that do not need it in fear that
> someone may try to use a member of their module, or too sparsely
> thus making reflection all but unuseable for many common
> situations.

Runtime reflection _must_ be opt-in. We do _not_ want to make all types pay the 
cost of having it. That means that however it's done is going to require that 
every type that has it be marked in one way or another to enable that 
functionality. That's part of the cost of being a systems language. Whatever 
solution we come up with must take that into account.

- Jonathan M Davis


More information about the Digitalmars-d mailing list