lua-users home
lua-l archive

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

> From the manual: "The variable var [loop counter] is local to the statement;
> you cannot use its value after the for ends." And for what it is worth,
> neither on a an external function! (?)

You're making a mountain out of a molehill: the two globalVars are 
different variables, one local, as declared by for, and the other global. 
The List function is declared outside the scope of the for loop (and hence 
the local variable.

> Is it normal the problem persists in Lua 5.0?

«normal» est un faux ami: on ne peut pas l'utiliser comme «normale». La 
problème est que, en anglais, «normal» est utilisé pour décrire quelque 
chose qui répète. On dit "Normally I get to work at 9 o'clock", mais pas 
"Normally I'll arrive in Paris at 6:15" (si on ne voyage regulièrement à 
Paris!); on doit dire "I should arrive in Paris at 6:15". Ici, j'aurais 
dit "Should the problem persist in Lua 5.0" ou "Is it correct that...".

-- | poetry, n.  platitude made obscure