lua-users home
lua-l archive

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


On 06/11/2012 08:07, spir wrote:

printf  = function (fmt, ...)
    local strings = {}
    for _,elt in arg do
       strings[#strings+1] = tostring(elt)
    end
    print(format(fmt, unpack(strings)))
end

Sorry, was really to early... read:

printf = function (fmt, ...)
   local strings = {}
   for i,elt in ipairs(arg) do
      strings[i] = tostring(elt)
   end
   write(format(fmt, unpack(strings)))
end

Denis