lua-users home
lua-l archive

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


--- RLake@oxfam.org.uk wrote:
>> Now, instead of having to muck about with tinserts and call(), I can
simply
>> use standard multiple-argument expansion:
>>
>> function printf(file, fmt, ...) write(file, format(fmt, argfn())) end
>> -- The argument fmt is only provided for documentation purposes --

> You can already do this with the 'unpack' function. For instance:

>  function printf(fmt, ...)
>    write(format(fmt, unpack(arg)))
>  end

Yeah, I know... I just thought it would be more cool (and faster) to not
have to make a table and then unpack it.

R.