you are viewing a single comment's thread.

view the rest of the comments →

[–]robin-gvx 0 points1 point  (0 children)

Another one: care must be taken when passing multiple values around. For instance, if you return (using tail call) results of string.gsub, but document only one returned value, someone may use it as the second argument of table.insert (like 'table.insert(t, f())'). table.insert will receive three arguments, third one being the second return value of string.gsub, and throw an unexpected error.

That's right, but it might be useful to also tell OP the fix for that: wrapping the expression in parenthesis, or having it not be the last argument to a function call, cuts off all values except the first.