Compiler patch for runtime reflection

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Oct 22 06:20:12 PDT 2011


On 10/22/11, Vladimir Panteleev <vladimir at thecybershadow.net> wrote:
> On Sat, 22 Oct 2011 13:50:32 +0300, Alex Rønne Petersen
> <xtzgzorex at gmail.com> wrote:
>
>> You could just introduce a -reflection switch to include reflection
>> information.
>
> As I mentioned in the previous thread on the subject, I think that ideally
> we should improve compile-time reflection so it's possible to generate
> runtime reflection information at compilation time. Something like this:
>
> import reflection;
>
> enum reflectionForStdStdio = generateReflectionForModule("std.stdio");
>
> void main()
> {
>      reflectionForStdStdio.callFunction("writeln", "Hello, world!");
> }
>
> --
> Best regards,
>   Vladimir                            mailto:vladimir at thecybershadow.net
>

I think user properties would be a perfect fit for this. :)

@reflected
struct Foo {}


More information about the Digitalmars-d mailing list