braceless with statements

Stefan Koch uplink.coder at googlemail.com
Sat Nov 13 11:10:41 UTC 2021


On Saturday, 13 November 2021 at 10:43:04 UTC, Ogi wrote:
> On Friday, 12 November 2021 at 15:33:38 UTC, Steven 
> Schveighoffer wrote:
>> No, you are wanting to use the members of `s` many times, and 
>> don't want to have to repeat `s.` all the time. This isn't a 
>> great example because of the brevity. But imagine a long 
>> expression instead of the single-letter variable.
>>
>> `with` already works as noted in the first case, the second 
>> case would just be a way to write the same thing but without 
>> braces (and indentation).
>
> I see, thanks.
>
> Can’t say I am a fan of this proposal. Are you in the same 
> scope as a few hundred lines above? With braces and 
> indentation, the answer is clear. Without them, you’ll have to 
> look for `with` labels that don’t stand out visually at all.

No you just look for the last open brace?
The with statement doesn't behave like a stand alone scope.


More information about the Digitalmars-d mailing list