May I introduce `lazy with`?

Timon Gehr timon.gehr at gmx.ch
Thu Nov 24 21:21:21 UTC 2022


On 24.11.22 20:27, Paul Backus wrote:
> On Thursday, 24 November 2022 at 17:41:20 UTC, Quirin Schroll wrote:
>> ...
> 
> I tried it on run.dlang.io and `member` is correctly resolved as 
> referring to the loop variable, not the enum member. Here's a complete, 
> compilable example:
> 
I guess the OP missed Walter's subsequent post:

On 19.11.22 19:46, Walter Bright wrote:
> On 11/19/2022 10:26 AM, H. S. Teoh wrote:
>>> Implicitly enclose the switch body with a `with (WordLetterOfTheDay)`
>>> resulting in:
> 
> Upon more reflection, the implicit `with` should only enclose the case 
> expression, not the other statements in the switch body.




More information about the Digitalmars-d mailing list