Open source dmd on Reddit!

Daniel Keep daniel.keep.lists at gmail.com
Sat Mar 7 16:53:06 PST 2009



Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> 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,
>>       ";
> 
> Have to resolve the ambiguity with template mixins for that to work.

mixin:blah
mixin.blah
mixin!blah

If you do something like this, I'd just want this to work:

mixin!bitfields("uint x : 2")

I use mixins with CTFE functions WAY MORE than I use them with templates.

Incidentally, writing something that parses the above language for
bitfields wouldn't be too hard.  I've done something similar for
defining properties.

  -- Daniel


More information about the Digitalmars-d-announce mailing list