Killing the comma operator
Lionello Lunesu via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 11 03:50:47 PDT 2016
On 10/5/2016 22:16, deadalnix wrote:
> On Tuesday, 10 May 2016 at 10:09:40 UTC, Andrei Alexandrescu wrote:
>> On 5/10/16 12:52 PM, Mathias Lang wrote:
>>> So, following DConf2016, I raised a P.R. to deprecate usage of the comma
>>> expressions, except within `for` loops increment [5].
>>
>> The agreed-upon ideea was to allow uses that don't use the result
>> (including for loops). No? -- Andrei
>
> Let's just make it of void type, there was plan to recycle the syntax
> maybe, but whatever we do in the future, this is the sensible first step.
Acutally, we can do two-birds-one-stone: instead of making it void, make
it a value tuple!
If the result of the comma operator gets used in a bug prone matter it
would cause a compile error! How is that for "Yeah, sorry, we broke your
code, but look what you got in return!"
Win-win!
More information about the Digitalmars-d
mailing list