Flag proposal

Ben Grabham Evil.Nebster at gmail.com
Sat Jun 11 11:12:32 PDT 2011


On 11/06/11 15:28, Andrei Alexandrescu wrote:
> On 6/11/11 9:08 AM, David Nadlinger wrote:
>> On 6/11/11 1:54 PM, Andrei Alexandrescu wrote:
>>> Consider two statements:
>>>
>>> 1. "I dislike Flag. It looks ugly to me."
>>>
>>> 2. "I dislike Flag. Instead I want named arguments."
>>>
>>> There is little retort to (1) - it simply counts as a vote against. For
>>> (2) the course of action is to point out the liabilities of changing the
>>> language.
>>
>> *And*, at least for me, still count it as an (informal) vote against
>> Flag.
>
> Of course it does, but the point is there are arguments that might
> convince the person.
>
>> You wrote about »The point is it [named arguments] would also have
>> disadvantages«, but at the same time, you seem to ignore that using a
>> non-obvious construct all over the standard library adds to perceived
>> the »language complexity« (from the user's perspective) just as well,
>> even more so if opDispatch or other »hacks« are used to beautify the
>> implementation.
>
> I agree that implementation complexity has a cost. That would be
> justified if the idiom becomes commonly used outside the library.
>
>> Yes, I do think named parameters would be a step forward and we should
>> definitely look into adding them to D. But independently, I don't think
>> that reinventing bool in Phobos is a good idea.
>
> You may want to refer to my answer to Michel.
>
>
> Andrei

Hey,

Don't know whether I can vote but I looked through it and I prefer using 
booleans over this. This just doesn't look very nice to me and if you 
*really* wanted to use this in a program, you could just use an enum but 
I don't see why flags is good (even after reading through all your 
counter-arguments).

Nebster


More information about the Digitalmars-d mailing list