Reflection

Bruno Medeiros daiphoenixNO at SPAMlycos.com
Fri Mar 3 09:39:51 PST 2006


Bruno Medeiros wrote:
> Bruno Medeiros wrote:
>>
>> Ok, this shows the usefulness of such feature, however there are some 
>> problems/limitations. It only works with primitive types (there is no 
>> isClass method of TypeInfo). For this feature to reach the full 
>> potential, then the TypeInfo class would have to be extended with info 
>> about the type's type, (i.e., the metatype, like struct, class, 
>> function, primitive, etc.), so that one could use reflection with 
>> non-primitive types, especially classes and arrays.
>>
> Strike that, we already have it. Upon further investigation I came to 
> object.d where there are children classes of TypeInfo for each of the 
> metatypes. Nice! :D
> 
> 

Hum, perhaps the member reflection could be in the the TypeInfo class 
itself. This way, not only structs could have reflection too, but maybe 
functions could also have a "members" like functionality with regards to 
their parameters! (thus achieving full type info for functions/delegates)



-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to 
be... unnatural."



More information about the Digitalmars-d mailing list