lua-users home
lua-l archive

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


On Tuesday 20 April 2004 00:39, Peter Loveday wrote:
> Greetings.
>
> I have a string containing a Lua value; this will likely be a table (though
> may not be), and in some cases may be a very large string (ie quite a few
> megabytes).  I want to effectively execute this string so as to get the
> value of it in a Lua variable; but the string will not have 'return' or
> anything on the beginning.  eg, it may simply appear as:
>
> "{ x = 7, y = 5}"
>
> Is there an efficient way that I can interpret a string as a Lua value,
> without having to copy the string in order to prepent a 'return' or 'val
> ='?

Use lua_load() with a custom chunkreader which adds the return?

-- Jamie Webb