Re: Lua and C - misc questions
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua and C - misc questions
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2005年8月23日 13:12:37 -0300
> well, thanks much, I understand the concept, but I don't know how to do
> it, could you please explain with some code snippets?
Start with this. --lhf
local g={} -- populate as desired
local G=getfenv()
setmetatable(g,{__index=G})
setfenv(1,g)
print"hello" -- uses print from G
print=23
G.print"hello" -- original print intact
print"hello" -- this raises an error