[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Message Passing/IPC in LUA
- From: David Given <dg@...>
- Date: Fri, 15 Sep 2006 14:59:49 +0100
Michael Panetta wrote:
> But this does not work, because when lua_dump creates the chunk, the
> upvalue gets lost.
Yeah, you can't dump functions with upvalues.
If I understand you correctly, you want to send a data structure from
one Lua universe to another Lua universe that may be in a different
address space, right? There are lots of ways of doing this depending on
your exact data structure, but the simplest is probably to serialise the
data structure into a string and send that. (Simple, but not
The code for this is pretty trivial; I don't have the 5.1 PiL, but the
5.0 PiL has a discussion of it here:
This version produces Lua code, so the unserialisation procedure
involves simply executing the string.
+- David Given --McQ-+ "You cannot truly appreciate _Atlas Shrugged_
| firstname.lastname@example.org | until you have read it in the original Klingon."
| (email@example.com) | --- Sea Wasp on r.a.sf.w
+- www.cowlark.com --+
Description: OpenPGP digital signature