Killing the comma operator

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu May 12 06:13:04 PDT 2016


On 5/11/16 1:10 PM, Kagamin wrote:
> On Wednesday, 11 May 2016 at 16:46:48 UTC, Nick Treleaven wrote:
>> In places where the comma operator does help,  use a
>> comma(expr,result) template function, implemented here:
>> http://forum.dlang.org/post/ngslcl$otg$1@digitalmars.com
>
> May not always work: https://dpaste.dzfl.pl/1ea0df70787b

Yep, that is true. I also found deep in the discussions of previous 
kill-comma-operator PRs, others have thought of the solution I came up with.

One possible "fix" would be to make all the parameters lazy, and 
evaluate them all before returning the last :) (Thanks Vladimir for 
showing us that possibility). But I'm not even going to try and 
implement that, it's horrific.

-Steve


More information about the Digitalmars-d mailing list