lua-users home
lua-l archive

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

2014-02-25 11:51 GMT+02:00 Ico <>:

> Are there other people out there who are having issues with tail call stack
> traces, and if so, how dow you handle this in real life debugging?

You could avoid tail calls until the program is debugged.

A tail call arises in this situation:

   return func(x,y,z)

If you don't know how many values func will return, you're stuck with
the tail call.

Otherwise you can do:

   local a,b,c = func(x,y,z)
   return a,b,c

If there is either exactly one return value or it does not matter
to replace return nothing by return nil, it's easier:

   return (func(x,y,z))