Open source dmd on Reddit!

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Mar 7 13:51:31 PST 2009


Charles Hixson wrote:
> mixin(bitfields!("
>      uint x :  2,
>      int  y :  3,
>      uint z :  2,
>      bool flag : 1,
>      ")
> so that it would be easier to shuffle the fields during development. 
> This has it's pluses and minuses, but by and large I think it's optional 
> presence would be a benefit.

That's a pretty neat idea. It's not difficult to implement, and it could 
possibly placate a few naysayers. And it's not ambiguous with the 
existing syntax either, so at least for a while both might be supported.

One improvement from the language could come from dropping the parens 
requirement for mixin, in which case:

  mixin bitfields!"
       uint x :  2,
       int  y :  3,
       uint z :  2,
       bool flag : 1,
       ";


Andrei


More information about the Digitalmars-d-announce mailing list