[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT2 and lua_dump()
- From: Nicolas <nicolas@...>
- Date: 02 Mar 2010 18:01:02 +0100
On 02 Mar 2010 17:44:19 +0100
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> > It does not even work if the function was defined inline somewhere like that:
> >
> > {
> > foo = function()
> > ....
> > end,
> > pop = "pup",
> > }
> >
> > There is no way to extract the currect code.
>
> struct lua_Debug contains these fields:
> int linedefined; /* (S) */
> int lastlinedefined; /* (S)
My bad :)
Yet extracting from line to line would not get me the code of the function
it would give me:
foo = function()
....
end,
which I cant extract and pass to loadstring (and it could be much worse
and be embeded in a line with many other things).
Anyway dump/load are indeed real nice for serializing :)