Flag proposal

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 10 16:16:14 PDT 2011


On 6/10/11 6:03 PM, Dmitry Olshansky wrote:
> On 11.06.2011 0:58, Andrei Alexandrescu wrote:
>> On 6/10/11 3:30 PM, Nick Sabalausky wrote:
>>> I really see Flag more as a way to try to rationalize avoiding adding
>>> named
>>> parameters to the language.
>>
>> There are fights that I believe are important and others that I think
>> are less so. I find name parameters nice to have but more in the
>> second category. There's just so much stuff that's more important.
>>
>>> And yes, the legibility of "foo(Flag!"param".yes,
>>> Flag!"otherParam".no);",
>>
>> Fair point. I figured this should be easier:
>>
>> foo(yes!"param", no!"otherParam");
>
> I think this looks not half bad and does not require change in the
> language.
> Still yes.param and no.param might be easier on the eyes, though IMO it
> should look more like just param and no.param.
> e.g.
> StopWatch(autoStart);
> StopWatch(no!autoStart); // or no.autoStart

Ask, and ye shall receive.

https://github.com/andralex/phobos/commit/801ccc96ce56827cd0d0b608895269bdccba4330


Andrei




More information about the Digitalmars-d mailing list