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

retard re at tard.com.invalid
Thu Jun 3 17:41:56 PDT 2010


Thu, 03 Jun 2010 15:08:08 -0400, Adam Ruppe wrote:

> On 6/3/10, bearophile <bearophileHUGS at lycos.com> wrote:
>> I have seen some situations where library solutions are not good enough
>> yet: - std.bitmanip.bitfields is a marvel of programming, but it's
>> trash any way: its code can't be maintained, modified, read. It's past
>> the limit of decency.
> 
> When it comes to code accessibility, the compiler is a black box. You
> can't edit it, even in theory, without breaking the language. A
> library's source might be ugly, but it is at least available for you to
> play with while still writing valid D code.
> 
>> And its syntax is not as good as C bitfields.
> 
> It is very close though.
> 
>> - The best library "typedef" shown so far can't be used two times in
>> the same line,
> 
> Note: you can use it twice on one line under some circumstances still.
> 
> But, be honest, have you ever actually put two typedefs on one line? If
> the limitation wasn't explained in the code, would you have ever noticed
> this?

Don't forget machine generated code. E.g. CTFE or parser generators


More information about the Digitalmars-d mailing list