need clarification: will typedef, C struct initialization, etc.

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jun 3 10:24:16 PDT 2010


On 06/03/2010 12:17 PM, Adam Ruppe wrote:
> On 6/3/10, bearophile<bearophileHUGS at lycos.com>  wrote:
>> My suggestion is to just improve the built-in typedef, instead of trying to
>> implement some hack in D.
>
> Do you consider ALL library solutions to be "hacks"? It sure seems
> that way at times.
>
> What we have here is individually useful language features able to
> completely replace another, specialized feature, and do even more!
> This strikes me as being a supremely elegant solution, not a hack.
>
> Fixing typedef ONLY fixes typedef, whereas fixing the helper
> components of Typedef can help a variety of things. If the helper
> templates are slow, improving template performance fixes that, and
> helps across the board!

Agreed. The reality was that typedef was in fact a hack; its semantics 
were quite erratic. A library-based solution can use the existing 
language to devise a principled artifact.

Andrei


More information about the Digitalmars-d mailing list