introduce membername and DDocComment Property?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Wed Dec 6 07:04:46 PST 2006
"davidl" <davidl at 126.com> wrote in message
news:op.tj4diqpqeb62bo at david.ars...
>
> why not introduce member's name to our tuple like we have
> class myclass
> {
> int membera; //membera is used for bar
> char[] memberb; //memberb is used for foo
> }
>
> auto a= new myclass;
> then we have a.tuple[0].membername reference to char[] 'membera'
> and a.tuple[1].membername reference to char[] 'memberb'
> a.tuple[0].ddoc reference to 'membera is used for bar'
> a.tuple[1].ddoc reference to 'memberb is used for foo'
>
> now we can have some meta programming for easy debugging!
I'd also really like the .membername property -- it seems only logical to
supply that as well as the type and the value. This would also make some
reflection possible.
But I hadn't thought of having a .ddoc member as well.. that's a great idea!
More information about the Digitalmars-d-learn
mailing list