lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


"Warlich, Christof" <christof.warlich@thermofisher.com> writes:

>> You've been using C/C++ too long :)
> Probably ;).

I don't think that I have seen any C++ style guide encourage anything
but block local loop variables, written like

for (int i=0; i<j; i++) ...

In fact, given C++' propensity to have variables with runtime
implications when instantiated and destroyed, it is usually a good idea
to minimize their life time.

And I have pretty much _never_ seen anybody use an actual _global_
variable for loop control, whether we are talking C or C++.

It is such an excessively bad idea that I would not care to see it as a
default in Lua.

-- 
David Kastrup