lua-users home
lua-l archive

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


>> why can't it be `loadfile([filename[, env]])` or `loadfile([filename[, mode[, env]]])`?

> It certainly can. The point is whether it should ;) It increases both
> the implementation and the manual (but by minimal amounts).

IMHO, it should, unless:

1) The "#!/usr/bin/lua" initial line is ignored by the parser instead
of the lua_loadfile function.
    BTW, I have already tried by accident to pass a chunk with such a
line to lua_loadstring.
2) The load() function is extended a little more, to accept
"@filename" as its first 'ld' parameter.
    So we could remove loadfile in addition to loadstring