[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Why not Just PHP-stupid include?
- From: Julien Duminil <julien.duminil@...>
- Date: Tue, 18 Oct 2011 15:34:51 +0200
> I do like locals but local to a do-end blocks or functions not
> necessary files. So here is a simple use case.
Let's see again your first example:
> (file oneVar.lua)
> local x = 1
>
> (file simpleTest.lua)
> print("starting")
> dofile("oneVar.lua")
> print(x)
> print("the end")
You have to see dofile("oneVar.lua") as:
do
php_dumb_include("oneVar.lua")
end
Also, dofile is done at runtime, not at compile time, so when you load simpleTest.lua, the compiler don't know that there is a local variable x defined in oneVar.lua.
Julien D.