Metacode mechanics

Don Clugston dac at nospam.com.au
Tue Feb 28 23:27:21 PST 2006


Craig Black wrote:
>> I'm sure that compile time reflection is the way to go.
>> We already have the .mangleof property, which maps any type to a string. 
>> Once we get array literals, you could have an array of strings showing all 
>> members of a given item.
>> eg a property
>> char [][] .membersof
>> which is valid for any type.
> 
> Compile-time reflection would be very nice.  I'm not sure I understand why 
> array literals would be a requirement for this.  Am I missing something?

It's because we can't have compile-time constant folding of [], except 
for char arrays, until we get array literals. Compile-time reflection 
_could_ be done without using arrays, but I think it's the most natural 
way of doing it, anything else would require new syntax or be a bit clunky?



More information about the Digitalmars-d-dtl mailing list