Why is it that the index variable controlling a for-loop shows up as <uninitialized> in debug mode, even when I'm in the middle of the loop?
For example, look at this snippet of code:
for i (1, 10, 1); j = i + 1; print i j; endfor;
When I'm in debug mode and on the third time around the loop, I try hovering my mouse over the i and j variables. i shows up as <uninitialized> but j shows up with the expected number. And the code doesn't have any issues running or anything like that.
Why is that?
This is because of some optimization that is done by the GAUSS compiler for
for loops. During a program run the loop counter is not a standard GAUSS variable like the others. As you know, it can be used in calculations and indexing without a problem, but it is not now available to the debugger to inspect.