Runtime reflection idea

Steven Schveighoffer schveiguy at yahoo.com
Thu May 30 10:24:11 PDT 2013


On Thu, 30 May 2013 13:10:35 -0400, Adam D. Ruppe  
<destructionator at gmail.com> wrote:

>> I would like to see the necessary framework for RTInfo to allow  
>> expansion WITHOUT having to modify object.d.  I think this can be done,  
>> and then it allows anyone to insert whatever they want for RTInfo based  
>> on their own needs.
>
> What's the difference between what you're thinking and what I outlined  
> here? I used strings, but it could just as well be interfaces (casted  
> back to a custom class at use time), or something to allow custom types  
> to be added and fetched too.

If you wanted to add interfaces, would you have to modify object.d?

What I'm saying is, make RTInfo extendable without having to modify  
object.d.  Each project could define how the compiler generates the RTInfo  
for it's specific needs, and everyone can use the same runtime.

I think your idea can do this if we just move MoreTypeInfo to be  
instantiated via a type member, so each type could decide how it's type  
info is generated.

-Steve


More information about the Digitalmars-d mailing list