lua-users home
lua-l archive

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


On 24/04/2013, at 7:17 PM, moonfruit <dkmoonfruit@gmail.com> wrote:

> I am wondering why LUA is be designed like this:
> 
>     j = 10     -- global variable
>     local i = 1 -- local variable
> 
> and not like python:
> 
>     global j = 10 -- global variable
>     i = 1          -- local variable
> 
> I usually forget to add local to variable declaring,
> Because nearly all programing language which I used default set variable's scope to local.
> 
> Is there someone can tell me why?

http://lua-users.org/wiki/LocalByDefault