lua-users home
lua-l archive

Re: unpack in lua5.1

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


On 28-Nov-06, at 11:31 PM, al_lea wrote:
I don't quite understand why you're packing an array in order to unpack
it in order to send it to a varargs function.
for g_load_new itself might be a ... passed in by other function, I just pack an
array here to boil down.
In 5.1, you can just send ..., which is effectively an expression list (i.e. it is not an object as such):
function log(level, fmt, ...)
 if log_enabled[level] then
 log_file:write(fmt:format(...))
 end
end

AltStyle によって変換されたページ (->オリジナル) /