Contract programming syntax
Christopher Wright
dhasenan at gmail.com
Wed Apr 8 19:59:08 PDT 2009
Jarrett Billingsley wrote:
> On Wed, Apr 8, 2009 at 6:38 PM, Christopher Wright <dhasenan at gmail.com> wrote:
>
>> Then take this example:
>>
>> void foo(int i)
>> {
>> if (i < 0) return;
>> in { assert (i != -1; }
>> }
>>
>> This is confusing.
>
> There's a simple solution: define the function body grammar to only
> allow in{} and out{} blocks at the beginning of the function, before
> any statements.
Or just your style guide. But even if you can demonstrate significant
benefits (and I don't see any benefits, really), inertia is against you.
I don't think Walter would change it for anything but extreme provocation.
More information about the Digitalmars-d
mailing list