Flag proposal

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Jun 10 16:20:14 PDT 2011


On 6/10/11, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> On 6/10/11 4:28 PM, Andrej Mitrovic wrote:
>> On 6/10/11, Lutger Blijdestijn<lutger.blijdestijn at gmail.com>  wrote:
>>> Changing a name will now break client code.
>>
>> The flag template suffers from the same issue.
>
> Actually, not. The name used with Flag is part of its type. Even in a
> separate compilation approach, the type names must match, which is not
> the case for parameter names.
>
> Andrei
>

I've either misread what Lutger said or I haven't stated my intentions
more clearly. Most probably both.. :)

By "breaking code", I'm referring to breaking compilation of existing
code, not breaking the runtime semantics.

You're doing this now:
Flag!"KeepTerminator" keepTerminator

You can change the variable name and the client code still compiles.
But are you going to keep the name "KeepTerminator" in sync with the
new variable name? It sure seems that's how this Flag template is
used. If you do, that means client code has to change as well.

Named arguments have the same problem. That's what I was referring to.


More information about the Digitalmars-d mailing list