Is This a Bug
Jonathan M Davis
jmdavisProg at gmx.com
Tue Oct 25 03:04:49 PDT 2011
On Tuesday, October 25, 2011 05:38:37 bearophile wrote:
> Jonathan M Davis:
> > If you want it to be pure, you mark it with pure. It doesn't have to be,
> > and it's too restrictive to require that it always is - though
> > obviously it would ideally be pure.
>
> I think it should be pure, as in other languages that have DbC... Its purity
> helps static code analysis too, I think.
Well, there's nothing stopping you from making your invariants pure, and in
general, it's probably good practice. But there's no reason to _require_ that
they be pure. Doing so would disallow potentially useful invariants for no
real benefit. Right now, you have the option of making the pure or impure, so
you get the best of both worlds.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list