Early versions of Fortran, I am told, allowed the programmer to redefine the value of seven by writing 7 = 8.1
We did something similar with C++, today, when we accidently redefined empty string (as in a literal ””) to be considerably less empty. It was surprising how much of our application didn’t break.
In the end, we traced the bug back to a call to the transform() STL function. When you call transform() on a string, you pass it a string::iterator telling it where to place the transformed characters. Unfortunately, string::iterator is a typedef for char *, so when you tell it to place the output into a new, empty string, guess what? The empty string literal gets clobbered.
1 Assuming you hadn’t messed up too many other literals, you could get it back again by writing 7 = 8 – 1.
Comments
There's a great obfuscated C program in there waiting to get out. Implementing a Turing Machine with reassigned literals? Rebuilding the integers inside the empty string? Using the integers you get that way with pointer arithmatic, to expand the set of integers?