contract programming without a function

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sun May 20 04:42:07 PDT 2007


Derek Parnell wrote:
> I don't believe that 'in' and 'out' can yet be used for nested functions or
> anonymous functions.

It works fine for nested functions:
---
import std.stdio;

void main()
{
     void nested()
     in {
         writefln("nested : in");
     } out {
         writefln("nested : out");
     } body {
         writefln("nested : body");
     }

     nested();
}
---

You seem to be right about anonymous functions though.


More information about the Digitalmars-d-learn mailing list