lua-users home
lua-l archive

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

Am 08.08.2016 um 16:31 schrieb Robert Virding <>:

On 8 August 2016 at 05:28, Coda Highland <> wrote:

The documentation is accurate. It's done by luaL_loadfilex and not
part of the more general chunk-loading functionality -- you can't
write load("#!/foo\nprint 'hi'") in Lua code and have it work.

/s/ Adam

Would it be safe to do it when I load a file but not when I load a string? Would this fit in with how users assume/expect it to work with Lua?

We usually load Lua code by memory mapping the file, and then passing
the buffer address to the actual loader function.

But we can deal with either way, as long as it is documented.