[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [lua4] Function to string
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 5 Sep 2003 11:30:56 -0300
>Is it possible with lua4 to get the string representation(bytecode)
>of a given function for latter sue with dostring() ?
No, sorry, not in Lua 4.0: You cannot get the bytecode nor can you load
bytecode with dostring. (You can do both in Lua 5.0.)
On the other hand, it is not too hard to add this to Lua 4.0: you'll have
to change a few macros in dump.c and wrap it around a C function. See
ldumplib.c in the defunct Lua 4.1 (alpha), which you get temporarily at
http://www.tecgraf.puc-rio.br/~lhf/tmp/lua-4.1-alpha.tar.gz
I don't know whether it works under Lua 4.0, but it will give a good idea
of what needs to be done.
--lhf