lua-users home
lua-l archive

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


On Thu, Mar 15, 2007 at 05:02:25PM -0700, Graham Wakefield wrote:
> >So I guess for his purpose, some sort of lower-level copy would be
> >necessary.
> >
> >-miles
> 
> Exactly.
> 
> Upvalues should be duplicated along with the function. 

Look at chapter 4 of the lua reference manual.

I think you can get/set upvalues of a c closure, but you can't get/set
locals of a lua closure (if its not currently active).

Even once you access the upvalue, duplicating it is not so easy in the
general case, you might have to do a deep copy of a table.

Sam