On 21/02/2019 17:05, Nikolai Zhubr wrote:
Actually no. Inline declarations (where implemented) are not limited
to a loop index and not even limited to a loop. If you have an option
to declare some few variables locally to some code block (e.g. FOR, as
well as IF, CASE, WHILE, etc), in case you know for sure from their
meaning that their values just make no sense outside of this very
block, you would know they do not leak out accidentally. This is
certainly not the same as detecting uninitialized variables. A
variable might be technically initialized, but at the same time its
value might make no sense outside of some scope (for the reasons of
your business logic or whatever else considerations).
Search the forum and mail history. The discussion has been add several
times. And there are plenty of more examples, why it is not good.
No point in repeating them. Especially not, since the decision has afaik
already been made long ago.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel