lua-users home
lua-l archive

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


By itself, that behaviour wasn't what was bothering me. It bothered me that attempting to load the file my script generated was failing. :)

Thanks, Philip Bock

Luiz Henrique de Figueiredo wrote:

The byte-code string.dump() generates seems to contain a copy of the
text of the source passed to loadstring. I notice that neither luac or
luac.lua seem to do this.


loadstring accepts an optional second argument that is the 'chunkname'.
If this argument is not present, loadstring uses the string itself and
so you get a copy of the source in the bytecode.

If you do not want this, call loadstring(s,"(noname)") or something.