compile time class introspection?

janderson askme at me.com
Thu Jun 14 22:50:05 PDT 2007


Serg Kovrov wrote:
> Chris Nicholson-Sauls wrote:
>> This is an important thing about D that probably deserves a long and 
>> extensive tutorial somewhere...  Many of its cooler features aren't 
>> really features at all, but side-effects of other more general features. 
> 
> I hope it won't happen. Let me explain..
> 
> Considered to be a side-effect (or hack), this rather should be 
> redesigned than teaching in docs/tutorials/books. That way we end up 
> with yet another C++
> 
> Its sad that I actually will use this hack (that is, will produce code 
> I'm not proud with). I can't just hope and wait for this to be fixed 
> (properly designed), as temptation to have this functionality is to strong.
> 
> 
> PS. Don't get me wrong, I really do like D
> -- serg.

I disagree, I think an orthogonal design like D is a good thing in many 
cases.  It means that you don't have to learn so many keywords and are 
more likely to determine the syntax yourself.  It also means code is 
generally easier to maintain due to generalization because you can often 
   reuse the code in more different ways then originally intended.

I don't regard the solution given as a hack it seems pretty obvious to 
me.  Either way it would have to be documented.  If you don't like it, 
write a wrapper template.

Also I don't think good orthogonality means the language has to get more 
complex.  I think its about making the common coding primitives easy to 
use however also making them powerful enough if the user wants to extend 
them to something that is less common.

-Joel


More information about the Digitalmars-d-learn mailing list