lua-users home
lua-l archive

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


>But doesn't that mean that currently on a unix system you wouldn't be able
>to have precompiled executables? That's not right. :-(

Yes, unfortunately. Like you said, perhaps this hints that this whole bussiness
should be handled elsewhere.

>Perhaps the chunk loading code should simply skip the "#! blah<newline>"
>preamble (if it exists) ... its format is the same regardless of whether the
>file is source code or precompiled Lua ... and THEN examine the next byte to
>determine whether the file is precompiled or not.

The problem is that files with precompiled code must be open in *binary* mode.
We look at the first byte to check this and reopen the file in binary mode
if it seems to contain precompiled code. To handle the #! thing we'd have to
read the first line.

>I couldn't find a reference to "string.dump" in the Lua5b reference manual.
>Does it take a function and return a string that is a compiled-module?

Yes.
--lhf