Flag proposal

Nick Sabalausky a at a.a
Fri Jun 10 14:42:03 PDT 2011


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.781.1307734245.14074.digitalmars-d at puremagic.com...
> On 2011-06-10 09:15, Andrei Alexandrescu wrote:
>> https://github.com/D-Programming-Language/phobos/pull/94
>>
>> Discuss!
>
> I do have to admit that as much as I hate the idea of named parameters, 
> this
> particular proposal certainly seems to be an argument in favor of adding 
> them,
> which would tend to argue against making these changes.
>
> After thinking about it, I'd argue that it would be better to create a 
> string
> mixin which created the enums for you instead of using the template as 
> part of
> the arguments. e.g.
>
> mixin(YesNoEnum!"KeepTerminator"));
>
> Then all of the rest of the code is the same. You'd still use
> KeepTerminator.yes and KeepTerminator.no, but we avoided having to create
> duplicate enums by hand every time that we want this kind of variable. So, 
> you
> still reduce the boilerplate code, but the usage is much less ugly.
>

I'd support this *as long as* it's existence didn't get used as 
rationalization for avoiding the inclusion of named arguments.





More information about the Digitalmars-d mailing list