DIP 1009--Improve Contract Usability--Preliminary Review Round 1
Moritz Maxeiner via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jun 23 13:03:17 PDT 2017
On Friday, 23 June 2017 at 19:38:11 UTC, MysticZach wrote:
> On Friday, 23 June 2017 at 18:42:55 UTC, Steven Schveighoffer
> wrote:
>> On 6/23/17 2:24 PM, Moritz Maxeiner wrote:
>>> I'm all for this syntax, just one spec/implementation
>>> question:
>>> If the new contract syntax (formally) shares grammar rules
>>> with assert, won't that cause more work for people who want
>>> to update the assert syntax later (since they will have to
>>> take contracts into account)?
>>
>> No. Asserts are the meat of in/out contracts, these are
>> actually asserts. Anything you do to the assert grammar should
>> be done here as well.
>
> I agree. I can understand wanting to pass in/out violations to
> a different handler behind the scenes. But I don't see why that
> should affect the grammar.
Because coupling the new contract syntax and assert syntax in the
grammar means that changing assert syntax will affect the new
contract syntax (when it shouldn't, as they are semantically
decoupled).
More information about the Digitalmars-d
mailing list