May 22, 2012
On Monday, 21 May 2012 at 09:35:30 UTC, Timon Gehr wrote:
>[cut]
> int x;
>
> void f(int){x=anything;}
>
> void main(){ f(x++); }


Yes, and that's why you're supposed to *avoid* the use of global variables as much as possible.. Thanks for showing that "lazy" has the same issue as global variables..


[cut]
> f(()=>x++) is already short enough.

I would prefer f({x++}) instead but that may be bikeshedding..

renoX

1 2 3
Next ›   Last »