lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi Asko,

On Thu, Jul 3, 2008 at 2:04 AM, Asko Kauppi <> wrote:
> Could future Lua have a mechanism similar to 'lua_pushcclosure' for Lua
> functions?  Is there some reason why this cannot (ever) be done?

I ran into this problem when memoizing a state. When you load the
binary string in Lua, the upvalues are set to nil. You can change them
manually using the debug library.

Also, I believe you may be looking for a way to share upvalues (that
is, two Lua functions may use the same upvalue)? I made a patch
recently that allows you to do this
( If you
intend to use it, please use this updated patch:


-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant