[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lexical environments: follow-up
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Sat, 6 Feb 2010 15:20:35 +0100
This is the last one: combining an hypothetical getfenv with my short
lambda suggestion, we get
function table.in(tabl, func)
setfenv(func,tabl)
func( getfenv(2) )
return tabl
end
foo=3
local t = table.in( {}, (env):
bar = env.foo -- bar now == 3
baz = 5
::)
Most importantly, this doesn't add any new semantics to the language.