lua-users home
lua-l archive

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


On 8/29/2014 9:03 PM, Andrew Starks wrote:
I'm curious about why it is not possible to do something like:

`function o.method(self, fun, ...)

success, ... = pcall(fun, ...)
--vararg now return values of fun
-etc.

end
`

I assume this has been a topic, because its use would be pretty obvious. I couldn't come up with anything via the googles, so could someone point the way to where this was discussed?


-Andrew

Try http://lua-users.org/wiki/VarargTheSecondClassCitizen for a discussion of issues. This topic is about Lua 5.1, but nothing has changed in subsequent versions with regard to varargs except the addition of table.pack.