[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Abusing Lua iterators for fun and profit
- From: Daurnimator <quae@...>
- Date: Thu, 5 Feb 2015 15:38:55 -0500
On 5 February 2015 at 15:35, Sean Conner <sean@conman.org> 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?)