Getting action on your favorite D issues
Alex
sascha.orlov at gmail.com
Sat Jun 6 17:57:50 UTC 2020
On Saturday, 6 June 2020, at 00:25:15 UTC, H. S. Teoh wrote:
> [... snip ...]
> OK, I'll stop now. :-P
>
>
> T
Sorry, but I have another one. The point in Schrödinger's matter
is not to formulate a state, which does not exist. On
observation, the cat is either dead or alive. With the current D
behavior, the state of the cat is more like in The Walking Dead.
´´´
auto schrodingersCat() @safe {
union Box { bool b; int spin; }
Box u;
u.spin = 2;
return u.b;
}
void main() @safe {
import std.stdio : writeln;
const b = schrodingersCat();
if(b & !b){
writeln("doomed");
} else {
if (b) writeln("alive");
if (!b) writeln("dead");
}
}
´´´
More information about the Digitalmars-d
mailing list