Re: Modifying a Closure in 5.0 Alpha
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Modifying a Closure in 5.0 Alpha
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2002年8月23日 08:53:21 -0300
> I once wrote a function for 4.0 to do this, see lua_getcclosure() at
> http://lua-users.org/wiki/LuaPowerPatches. At the time Roberto said
> they might add it to the next version of Lua, but this feature doesn't
> get requested much and has fallen into the cracks.
We are still planning to put it, but it would work only to read upvalues
(not to set them); it would be more a debugging tool. If you need more
flexibility from upvalues, use a table instead (as ET already pointed
out). Then you have complete freedom to do whatever you want (add new
values, change them, share them across different closures, etc.)
-- Roberto