www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Reflection Alternative

reply "Kent Boogaart" <kentcb internode.on.net> writes:
Hi All,

D doesn't support reflection does it? I can't, for example, create an 
instance of a type based on its name?

I'm just trying to think how I would read a file containing a map and create 
instances of types based on what is in that file. I'd basically have to 
correlate codes with types and hard-code the creation of those types, yes?

Thanks,
Kent 
Sep 15 2006
parent Sean Kelly <sean f4.ca> writes:
Kent Boogaart wrote:
 Hi All,
 
 D doesn't support reflection does it? I can't, for example, create an 
 instance of a type based on its name?

Not currently, though DDL sounds like it might make this possible.
 I'm just trying to think how I would read a file containing a map and create 
 instances of types based on what is in that file. I'd basically have to 
 correlate codes with types and hard-code the creation of those types, yes?

Pretty much as in C++, yes. Sean
Sep 15 2006