lua-users home
lua-l archive

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



Pan Shi Zhu kirjoitti 22.3.2010 kello 2:44:

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?

Absolutely.

Though Lanes does not do the transfer for you, and the architectures of the two machines need to match.

- asko

ps. "Absolutely" above naturally implies it's a Lua function. A C function usable in Lua can hardly be serialized.