Next | You can't get there from here | 31 |
What happens when we call ouch on its own source code?
my $ouchcode = "sub { use Acme::HaltingProblem; my $arg = shift; if (halts($arg, $arg)) { 1 while 1 } else { return } }";
my $ouch = eval $ouchcode; $ouch->($ouchcode);
The first thing ouch does is call halts()
It asks "What do I do when called on my own source code?
Whatever halts() says, it does the opposite!
Conclusion: halts() must return the wrong answer
(or no answer at all)
Which is why the module doesn't work
Next | Copyright © 2005 M. J. Dominus |