[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table deep copy in C/CPP
- From: Patrick Donnelly <batrick@...>
- Date: Sun, 21 Mar 2010 22:10:50 -0400
On Sun, Mar 21, 2010 at 8:44 PM, Pan Shi Zhu <pan.shizhu@gmail.com> wrote:
> On Sun, Mar 21, 2010 at 7:41 PM, Asko Kauppi <askok@dnainternet.net> wrote:
>>
>> I think it did not copy the environment, though that could actually be
>> implemented if needed.
>>
>> It would copy the function given as upvalue. It only stops when there's a
>> recursion (i.e. it cannot copy a function which has itself as upvalue,
>> though even this could possibly be implemented, if needed).
>>
>
> What I want is to serialize a function and transmit it in a network
> socket, then unserialize it in another process (the process runs on
> another computer).
>
> does lua lanes copied function support this?
Here's a Lua serialization library I wrote for an IRC bot. It can
serialize anything but unknown C functions, all userdata, and
coroutines. (It also uses the debug.upvalue & debug.upvaluejoin from
Lua 5.2 but this is backwards compatible.)
http://www.batbytes.com/serialize.lua
--
- Patrick Donnelly
- References:
- table deep copy in C/CPP, Mariusz Stanisz
- Re: table deep copy in C/CPP, Luiz Henrique de Figueiredo
- Re: table deep copy in C/CPP, Mariusz Stanisz
- Re: table deep copy in C/CPP, Luiz Henrique de Figueiredo
- Re: table deep copy in C/CPP, Mark Hamburg
- Re: table deep copy in C/CPP, Pan Shi Zhu
- Re: table deep copy in C/CPP, Asko Kauppi
- Re: table deep copy in C/CPP, Mark Hamburg
- Re: table deep copy in C/CPP, Asko Kauppi
- Re: table deep copy in C/CPP, Pan Shi Zhu