On 04/08/2013 08:14 PM, Simen Kjaeraas wrote:... one clear application of this being pseudo-random number generation, where
> Like others have stated, it's so you can do this:
>
> struct Foo {
> int a = 0;
> pure int bar( int n ) { // Weakly pure
> a += n;
> return a;
> }
> }
>
> pure int Baz( int n ) { // Strongly pure
> Foo foo;
> return foo.bar( n );
> }
you have a state variable together with a (pure) update function.