lua-users home
lua-l archive

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



On Thu, Jan 30, 2014 at 6:15 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
It is a nice hack, but if you miss printf, here it is:

function printf(...)
        return io.write(string.format(...))
end

It occurred to me that my attempt at humor may not have come across. :( If not, please know that I'm happy that Lua does not include printf and that I think that its absence is an example of my favorite attribute of Lua. Please accept my token of gratitude:

```lua
getmetatable('').__call = string.format
print(("%snk%s")("Tha", ("%sy%s")(" ", ("ou%s")(("%sfor%s")(", ", ("%sk%s")(" ", ("e%s")(("epi%s")(("n%s")(("%sL%s")(("%s ")("g"), ("%s sm%s")("ua", ("all%s")((" a%s")(("%sd %s")("n", ("%saut%s")("be", ("%su%s")("if", "l."))))))))))))))))
```

:)


--Andrew