Can we fix this?

Tejas notrealemail at gmail.com
Thu Sep 30 13:26:21 UTC 2021


On Thursday, 30 September 2021 at 13:23:06 UTC, Imperatorn wrote:
> On Thursday, 30 September 2021 at 01:00:40 UTC, deadalnix wrote:
>> On Wednesday, 29 September 2021 at 16:23:34 UTC, Imperatorn 
>> wrote:
>>> I'm still a bit confused. What is the recommended approach 
>>> here? Should we fix the language or have best 
>>> practices/documentation on how to "work around" the problem.
>>
>> I'm afraid this topic has come again and again, and Walter 
>> consistently says that it is not a bug, so we are stuck 
>> complaining. Maybe you can convince him.
>
> Maybe, idk.
>
> But I don't understand why we can't just do what (for example) 
> C# does.
>
> No var in loop = closure captures the variable
> var in loop = closure captures the value of the variable
>
> Sounds to me like a pretty "easy" thing to fix (if one could 
> agree that such a solution would be acceptible)

Because Walter thinks that duplicating behavior like C#'s and 
other languages' will result in a huge performance hit, leading 
users to get very frustrated.

Here's the link : 
https://forum.dlang.org/post/s83nb0$12rh$1@digitalmars.com


More information about the Digitalmars-d mailing list