lua-users home
lua-l archive

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

>How hard would it be to modify Lua source code
>to add "global" keyword for explicit declaration 
>of global variables and make all variables local
>by default?

This is one thing I never understood. Why is it implemented that way - in 
all other programming languages (that I know) variables in 
subroutines/functions are automatically local. Is there a reason, why it 
is implemented the other way round? 

Martin Döring, Systemtechnik (IDT)
MAN Nutzfahrzeuge AG
Dachauerstraße 667
D-80995 München

Tel.:   +49(0)89 / 1580 - 1199
Fax:   +49(0)89 / 1580 - 91-1199