Out contracts: how to refer to objects' start state

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 27 07:31:31 PDT 2013


On 5/27/13 3:42 AM, Jonathan M Davis wrote:
> On Monday, May 27, 2013 09:37:38 deadalnix wrote:
>> On Sunday, 26 May 2013 at 00:43:36 UTC, Andrei Alexandrescu wrote:
>>> That was technically difficult to do back then, and fell by the
>>> wayside. Today it would break too much code to introduce even
>>> if feasible.
>>
>> Can you expand more on the breakage risk please ?
>
> If nothing else, it would mean that the variables inside of the in block would
> not go out of scope when the in block ended, so their destructors would not be
> called and the like, whereas now they would be. The same goes for scope
> statements in the in block. I don't know how much of an issue any of that is
> realistically though. But Andrei may have other reasons why it would be a
> problem.

Oh, destructors too.

Andrei



More information about the Digitalmars-d mailing list