A couple of extensions to `with` that would be worthwhile

Basile B. b2.temp at gmx.com
Wed Oct 13 13:21:42 UTC 2021


On Wednesday, 13 October 2021 at 13:20:02 UTC, Paul Backus wrote:
> On Wednesday, 13 October 2021 at 13:16:36 UTC, Basile B. wrote:
>> I think that the point of proposal 1 is to have something 
>> like, after lowering to common AST constructs:
>>
>> ```d
>> {
>>   {
>>     auto xpath = ....;
>>     scope (exit) destroy(xpath)
>>     // stuff
>>   }
>>   // destroy(xpath) really happens here
>> }
>> ```
>
> Destructors are already called automatically at the end of a 
> block scope.

so proposal 1. is definitively not useful.


More information about the Digitalmars-d mailing list