[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Local and Global Variables
- From: Geoff Leyland <geoff_leyland@...>
- Date: Wed, 24 Apr 2013 19:25:05 +1200
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