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,
    Derek


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

> On 2016-02-12, at 8:38 PM, Derek Bailey <dbaileychess@gmail.com> 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.

Jay