lua-users home
lua-l archive

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


On 8/04/2011, at 9:52 PM, Francois Xavier Roure wrote:

> if we execute the following code:
> function toto()
>  return "a", "b", "c"
> end
> print(toto(), toto())
> 
> is it normal to get
> a    a    b    c
> as result instead of
> a    b    c    a    b    c
> ?

Yes.  In this case Lua only keeps multiple return values from a function if that function is the *last* argument to the function you're calling.  See http://www.lua.org/manual/5.1/manual.html#2.5