optional assignment

Basile B. b2.temp at gmx.com
Wed Feb 5 15:41:49 UTC 2025


On Wednesday, 5 February 2025 at 15:34:29 UTC, Basile B. wrote:
> On Sunday, 2 February 2025 at 03:30:17 UTC, Walter Bright wrote:
>> ```
>> if (!a) a = b;
>> ```
>>
>> Doesn't seem that bad. I did some searches and found hardly 
>> any instances of it, though that was across the dmd sources.
>
> I dont't know what regex have you used but here I've just tried 
> `if( )+\(\![a-zA-Z_][a-zA-Z_0-9.]*\` and almost directly found 
> an interesting example in typesem.d:

forgot the rparen: `if( )+\(\![a-zA-Z_][a-zA-Z_0-9.]*\)`


More information about the dip.ideas mailing list