[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: printf and/or %n
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 6 Nov 2012 07:46:33 -0200
> Or, is there a way to write a kind of printf (not C's) where the caller
> would not have to manually tostring every arg which is not a string or a
> number (provided a tostring func exists for the args in question), before
> letting it processed by format?
string.format in Lua 5.2 already does that, doesn't it?
function test(x) print(x,string.format("%s",x)) end
test(1)
test(nil)
test("hello")
test(true)
test(print)
test(io.stdin)