lua-users home
lua-l archive

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


Gregg Reynolds wrote:

There's something I'm not understanding about dofile.  The manual says:
" Returns all values returned by the chunk"

The chunk (the entire body of a file) is considered a function. So it can explicitely return something, e.g.

-- foo.lua
-- some stuff
return 5, 6, "bar"
-- end of foo.lua

return doesn't have to be the last statement but it has to be "top-level" that is, not inside some function.

--
Shmuel