Hello Denis,

OTOH, if you want to protect yourself from (accidental) global state
mutation, you are free to declare your static function as pure:

struct X
{
static int x;
static void foo() pure
{
// x = 3; // error
}
static void bar()
{
x = 3; // okay
}
}

I was thinking about providing contract to function, that it does not *modify* state, something as half-pure. Anyway, this would be hard to define correctly.


Reply via email to