lua-users home
lua-l archive

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

If func(x) returns multiple values and you do

return func(x), something_else()

it is going to adjust the func(x) it to a single value.

I am curious if this adjustment happens before or after the call to "something_else". If it gets resolved before, the something_else can be a proper tail call, otherwise it won't be a true tail call because the arguments have to get adjusted and therefore the stack frame must be preserved.

Take Care,

On Sat, Feb 13, 2016 at 9:38 AM, Jay Carlson <> wrote:

> On 2016-02-12, at 8:38 PM, Derek Bailey <> wrote:
> In PiL ed 3, Section 6.3 on Proper Tail Calls it says the only calls that follow the following form are proper tail calls:
> return func(args)

Note that if calling "func(x)" returns multiple values, "return func(x)" will return multiple values.