lua-users home
lua-l archive

Re: Protocol Specification in Lua

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


* On 2010年10月02日 Sean Conner <sean@conman.org> wrote :
> Okay, now I'm curious---how does one *get* a compiled Lua table? I can
> see how to get a Lua function (in fact, I'm doing that now, only between
> separate Lua instances and not over a network connection) but a table? 
What about compiling a function returning the table:
 function foo()
 return { "one", "two", "three" }
 end
 
 local compiled = string.dump(foo)
and to retrieve the table do a loadstring:
 ti loadstring(compiled)()
-- 
:wq
^X^Cy^K^X^C^C^C^C

AltStyle によって変換されたページ (->オリジナル) /