Compiler patch for runtime reflection

Gor Gyolchanyan gor.f.gyolchanyan at
Tue Oct 25 04:30:04 PDT 2011

You can always write @noreflect: at the start of your module and it
will work as expected. what's the problem with that?
Also, compiler would be able to automatically add that attribute to
any symbol, which is private and does not escape the module.
Again, not including reflection is purely _optimization_ issue and
should not be interfered with it's functionality.
Reflection is something you rarely have in mind when designing, for
example, classes.
Requiring explicit request for reflection defeats the purpose.

You could just as well say "writing public on every member is a
clutter". It is, but you don't have to do it to achieve the same

On Tue, Oct 25, 2011 at 2:58 PM, Timon Gehr <timon.gehr at> wrote:
> On 10/25/2011 11:24 AM, Gor Gyolchanyan wrote:
>> I said it once, but nobody responded.
>> Why not generate full reflection for everything by default and add an
>> attribute line @noreflect as an _optimization_ tool in cases, where
>> this thing is definitely not gonna be used in reflection?
> As I see it, because you almost never need 'full reflection for everything',
> and idiomatic D code is not supposed to contain clutter like that.

More information about the Digitalmars-d mailing list