[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: I ask a lua to call a function from file A.lua, instead, it calls it from file B.lua
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 7 Jun 2012 08:17:31 +0200
2012/6/6 Maha Akkari <maha.akkari@gmail.com>:
>
> I have two lua files in the same directory, file A.lua and B.lua. both
> files are identical except for their Id variable.
> (i.e. A.lua and B.lua have the same methods , however, A.lua has a variable
> id=1 and B.lua has variable id=2)
> ...
> any idea why is this happening ?
As Thijs warned, I'm just guessing … but I happen to enjoy
making this particular guess!
Is your code similar to this?
--- A.lua
id = "This is A"
return function() print(id) end
--- B.lua
id = "This is B"
return function() print(id) end
---
> A=require"A"
> B=require"B"
> A() --> This is B