lua-users home
lua-l archive

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


> At the first call, 'reader' returns 'nil'.
> At the second call, 'reader' returns a string with code.
> But Lua 5.1.4 bypasses the first 'nil'.

Thanks for the report.

It can be argued that your reader function is not following the implicit
contract in the manual:
	"To signal the end of the chunk, the reader must return NULL"
	http://www.lua.org/manual/5.1/manual.html#lua_Reader

Now the manual does not say that the reader function cannot return NULL
once and later return something else. The code in the Lua core assumed
it won't. That was the problem.