Thread overview
[Issue 6946] Compile-time flags generator
Apr 11, 2014
Nick Treleaven
Apr 11, 2014
Orvid King
Apr 12, 2014
Nick Treleaven
Dec 17, 2022
Iain Buclaw
April 11, 2014
https://issues.dlang.org/show_bug.cgi?id=6946

--- Comment #12 from Nick Treleaven <ntrel-public@yahoo.co.uk> ---
(In reply to bearophile_hugs from comment #11)
> (In reply to comment #10)
> > mixin BitFlags!q{A, B, C, D} MyFlags;

A better reason for this syntax is that is gives a name for ddoc to use for documentation. Unfortunately the members can't be documented though.

> Is your version using a function like isReservedWord() I have shown in the
> first posts here?

I haven't actually implemented it, it could do.

--
April 11, 2014
Actually, if we would already be doing partial tokenization, then I
would suspect it wouldn't be that hard to add support for extracting
documentation and putting them in the generated code for the mixin.
Also, to keep with standard D style, where the name of the type comes
before it's definition, perhaps the recommended syntax for the mixin
would be (provided it's currently possible):
mixin MyFlags = BitFlags!q{ A, B, C, D };

On 4/11/14, d-bugmail@puremagic.com <d-bugmail@puremagic.com> wrote:
> https://issues.dlang.org/show_bug.cgi?id=6946
>
> --- Comment #12 from Nick Treleaven <ntrel-public@yahoo.co.uk> ---
> (In reply to bearophile_hugs from comment #11)
>> (In reply to comment #10)
>> > mixin BitFlags!q{A, B, C, D} MyFlags;
>
> A better reason for this syntax is that is gives a name for ddoc to use for documentation. Unfortunately the members can't be documented though.
>
>> Is your version using a function like isReservedWord() I have shown in
>> the
>> first posts here?
>
> I haven't actually implemented it, it could do.
>
> --
>
April 12, 2014
On 11/04/2014 13:39, Orvid King wrote:
> Actually, if we would already be doing partial tokenization, then I
> would suspect it wouldn't be that hard to add support for extracting
> documentation and putting them in the generated code for the mixin.

See:
https://issues.dlang.org/show_bug.cgi?id=2420

> Also, to keep with standard D style, where the name of the type comes
> before it's definition, perhaps the recommended syntax for the mixin
> would be (provided it's currently possible):
> mixin MyFlags = BitFlags!q{ A, B, C, D };

I suggested this in an earlier comment ;-) Do you want to file a bugzilla enhancement?

BTW commenting in bugzilla is probably better than here.
October 15, 2016
https://issues.dlang.org/show_bug.cgi?id=6946

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp
                 CC|                            |andrei@erdani.com

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=6946

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--