Contract programming syntax

Jarrett Billingsley jarrett.billingsley at gmail.com
Wed Apr 8 15:02:17 PDT 2009


On Wed, Apr 8, 2009 at 5:32 PM, Frits van Bommel
<fvbommel at remwovexcapss.nl> wrote:
>
> Not technically true -- contract can contain more than raw asserts.
> For example, it might contain a non-trivial loop (such as a foreach which
> calls a virtual opApply) which may be hard for the compiler to optimize out
> even if it can deduce the body is a no-op (because it only contained
> assertions, most likely).

Sure, but most of my contracts are composed entirely of asserts.  And
there's always the debug{} block.



More information about the Digitalmars-d mailing list