[Issue 2043] Closure outer variables in nested blocks are not allocated/instantiated correctly.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 1 06:55:41 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=2043

Gabor Mezo <gabor.mezo at outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gabor.mezo at outlook.com

--- Comment #10 from Gabor Mezo <gabor.mezo at outlook.com> ---
Actually, I find this style of workaround mutch more readable than we seen
before:

foreach (idx; 1 .. data.length)
{
 (idx)
 {
   // Do stuff
 }(idx);
}

It not looks too ugly if you have some JS background. :)

Please fix this bug ASAP. I really like this language but this POS always makes
me sad if I take a look at my code.

--


More information about the Digitalmars-d-bugs mailing list