On Tuesday, 21 October 2014 at 08:48:09 UTC, safety0ff wrote:
On Tuesday, 21 October 2014 at 08:25:07 UTC, bearophile wrote:
Minas Mina:

Aren't pure functions supposed to return the same result every time? If yes, it is correct to not accept it.

But how can main() not be pure? Or, how can't the 'a' array be immutable?

Bye,
bearophile

There can exist a mutable reference to a's underlying memory:

const int[] a;
int[] b;

static this()
{
    b = [1];
    a = b;
}

Ant this code works? What is the point of const then if you can assign it to mutable slice?

Reply via email to