compile time class introspection?
Hasan Aljudy
hasan.aljudy at gmail.com
Fri Jun 15 00:33:09 PDT 2007
janderson wrote:
> Serg Kovrov wrote:
>> Beginning of the thread is in digitalmars.D.learn
>>
>> 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. So, to reuse this same example, no D doesn't have a way to
>>> ask if a class or structure has a particular method. D /does/ have a
>>> way to check for valid types... which, incidentally, non-existant
>>> members are invalid types. So, voila, a side-effect of checking its
>>> type is that you confirm it exists.
>>>
>>> There are others... a plethora, even. Walter is fond of lots of
>>> small things that can be put together to achieve amazing things --
>>> and I don't strictly disagree -- but it isn't usually obvious what
>>> you can do with those nifty little gadgets.
>>>
>>> -- Chris Nicholson-Sauls
>>
>> This is really sad that it turned this way. As I understand Walter
>> himself criticizes such approach:
>>
>> "Many useful aspects of C++ templates have been discovered rather than
>> designed."
>>
>
> I think its great in C++ that you can do more with it then indented. Why
> limit the programmers imagination? Sure some hacks should be program
> features, like the static_assert. However, I think its great that you
> could have static assets in C/++ at all. In fact many of the
> "improvements" D has are from some great ideas programmers "hacked" into
> C++.
>
IMHO:
That's not too bad when your experimenting.
But it's really really bad for a programming language that is being used
for commercial applications.
More information about the Digitalmars-d
mailing list