lua-users home
lua-l archive

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


"Tom Miles" <Tom@creative-assembly.co.uk> writes:

> Okay, so I'm obviously missing something with this.  Can anyone explain the
> behaviour from this:
>  
> function test1()
>     return 1, 2
> end
>  
> function test2()
>     return 3,4
> end
>  
> print(test1(), test2())
>  
>> 1    3    4
>  
> I would have expected it to output 1    2    3    4.  Why doesn't it?

Only the last function in a comma list has multiple return values
respected.

-- 
David Kastrup