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

Cheers,
Eric


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com