Hi,
In my opinion, using such a (mis)feature in a useful program is as silly as the result it gives. And if this kind of schema is required (?), what about using a 'while' or 'repeat' loop instead? Then you can modify the loop index inside of the loop body the right way, safely and - most of all - with PREDICTABLE results.
I think dropping this feature would be an enhancement.
My 2 cents
Pascal Viandier
pascal@accovia.com
-----Message d'origine----- De : gpc-owner@gnu.de [mailto:gpc-owner@gnu.de] De la part de Frank Heckenbach Envoyé : June 29, 2005 02:19 À : gpc@gnu.de Objet : Dropping some misfeatures in for-loops and`absolute' variables
GPC accepts the following program, but produces quite silly results:
<snip>
The problem is that it evaluates the index i each time, not once before the loop. It would be possible to fix it, but do we really want that? Neither BP nor CP/EP allow it, they allow only identifiers in for-loops.
Waldek and I see no need for such a feature. (If it made it possible to nest a compile-time-unknown number of `for' loops, I could see some point, but of course, it doesn't.)
So, would anybody mind dropping this misfeature, and requiring an identifier in for-loop counters?
<snip>
I suppose (hope) few users actually knew about the extended (mis)features GPC allowed, so I hope we can drop them. (If not, we probably should change semantics to evaluate the address once, and not on each usage, as is done now, so if you rely on this behaviour, you might have to change your code anyway -- if nothing else helps, you can always achieve the same effect with type-casting of pointers.) BP compatible code will not be affected.
Any objections?
Frank