Contract programming syntax

Jarrett Billingsley jarrett.billingsley at gmail.com
Wed Apr 8 15:44:09 PDT 2009


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.



More information about the Digitalmars-d mailing list