Why typedef's shouldn't have been removed :(

bearophile bearophileHUGS at lycos.com
Sat May 5 04:09:48 PDT 2012


Mehrdad:
> Now it's impossible to figure out whether a ParameterTypeTuple 
> contains an HWND versus an HGDIOBJ or whatever...
>
> this should really be fixed...

typedef is a quite useful feature, but the one present in D was 
unsound/broken, especially in presence of OOP. Fixing language 
features is hard (people didn't seem to understand that typedef 
is not meant to be used with classes), once their semantics is 
defined, it's quite hard to fix it. But adding features to 
D/Phobos is much simpler. So once there is a clear and sound 
design for what this feature has to do and its semantics, I 
expect to see in D a way to do the same things. Currently the 
Typedef in Phobos is more broken than the built-in typedef. Here 
the Ada language is a good reference to copy from. So the idea of 
removing typedef was good iff we eventually have something good 
to replace it.

Bye,
bearophile


More information about the Digitalmars-d mailing list