Hacker News new | ask | show | jobs
by jcelerier 1928 days ago
> In D, `immutable(int)* x` cannot be changed by any reference to the value.

even if I use a magnetic needle to change the bits in my RAM ? :)

1 comments

There's an easy answer to that: using a magnetic needle to change the bits in your RAM violated the assumptions of the compiler, leading to undefined behaviour. What exactly will happen in that circumstance is just that: undefined.
To put that another way: hardware failures are beyond the scope of the compiler.
Maybe your compiler.