[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why not Just PHP-stupid include?
- From: Joshua Jensen <josh.jjensen@...>
- Date: Tue, 18 Oct 2011 09:45:15 -0600
----- Original Message -----
From: Patrick Mc(avery
Date: 10/18/2011 8:42 AM
On 11-10-18 10:01 AM, email@example.com wrote:
You do realize that in your example x is local but silly1 is global,
Let's say I define 1 function and put it in a file called function.lua,
it looks something like this:
function silly1() print "reallly long string that greets user" end
and define 1 local variable
local x = 10
and put it in another file called local.lua.
Why don't you declare x as a global? It seems to me that it's what
No I meant them both to be local, it's not real code for anything I
want to do. I am just trying to say that if I type local x = 1 in
another file and then include it, I would like it become local to
where it was included from and not the file it was defined in.
FWIW, I was asking for something similar in .
 - http://lua-users.org/lists/lua-l/2011-08/msg00910.html