lua-users home
lua-l archive

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

On 07/05/2011 14.45, Peter Cawley wrote:
On Sat, May 7, 2011 at 1:41 PM, Roberto Ierusalimschy
<>  wrote:
  loadin(env, io.lines(file, "*L"), path)

Is it mandated by the reference manual that all implementations of Lua
must return a single function rather than an iterator tuple for things
like io.lines, string.gmatch, etc?

From top of content.html, Lua 5.1.4 html docs:

"The reference manual is the official definition of the Lua language. [...] "

Thus, for what I may infer, it is also the official definition of the default libraries (I assume that in that sentence "language" refers to both core and libraries).

Therefore if io.lines returns a single function, that is the expected behaviour of any "conforming" implementation, as I understand it.