lua-users home
lua-l archive

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

On 5 February 2015 at 15:35, Sean Conner <> wrote:
> can I
> rely upon this behavior of io.lines() and string.gmatch() to only return a
> single function?  I tested it on Lua 5.1, 5.2, 5.3 and LuaJIT, and in each
> case, only a function was returned.  Am I relying upon an implementation
> detail?  Should I use the first version, where I pass in the state and value
> each time, to be "safe"?

Yes. this is an implementation detail. please do not rely on it.
It just happens to be that state and 'var_1' are nil

IIRC this caught out a few people/modules when run under alternate
implementations (was it Kahlua?)