lua-users home
lua-l archive

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


>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