Thread:User talk:CodeCat/Lua and templates/reply (2)

I fail to see how Lua "tables" help in any way to format output. I see how you did the formatting on Module:ca-verb and Module:nl-verb, and although it's not too unreadable, it's not as readable as it could be. Do you happen to know if Lua has anything similar to Python's str.format? In Python if you have a dictionary with a lot of keys, you can format it like this:

s = "{foo} fish, {bar} fish, {baz} fish, {quux} fish".format(**d)

Which given d = {"foo": "one", "bar": "two", "baz": "red", "quux": "blue"} would set s to "one fish, two fish, red fish, blue fish". If Lua has something like that, then that would solve everything.