[Info-vax] BASIC (and Horizon)
Arne Vajhøj
arne at vajhoej.dk
Wed Jan 31 17:13:26 EST 2024
On 1/31/2024 4:24 PM, Lawrence D'Oliveiro wrote:
> On Wed, 31 Jan 2024 10:20:35 -0500, Arne Vajhøj wrote:
>> For the not VB.NET knowledgable:
>>
>> Using o1 As New X("A")
>> ...
>> End Using
>>
>> calls o1.Dispose() when the block is exited no matter how it is exited -
>> normal or exception does not matter Dispose is always called.
>
> Python has “context managers” which are a generalization of this. It also
> has “try/finally” blocks, which are good for one-off cases.
C# was born with using (2002), Python got with in 2.5 (2006)
and Java got try with resource in 1.7 (2011).
MS got a good idea and the rest copied it.
Arne
More information about the Info-vax
mailing list