lua-users home
lua-l archive

[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