[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: CHanging the order of parameters, is that possible?
- From: Marc Balmer <marc@...>
- Date: Sat, 5 Jan 2013 17:07:37 +0100
Is it possible to change the order of parameters in a function taking varargs? Maybe using the select(n, ...) function?
This is what I want to do:
function foo(fmt, ...)
-- switch element 1 and 2 of {...}
print(string.format('%d %s', ...))
end
foo('%s %d', 42, 'balmer')
(background is doing i18n in Lua, whith messages (= format strings) that can have the order of parameters changed)
- Follow-Ups:
- Re: CHanging the order of parameters, is that possible?, Alexander Gladysh
- Re: CHanging the order of parameters, is that possible?, Thijs Schreijer
- Re: CHanging the order of parameters, is that possible?, Rena
- Re: CHanging the order of parameters, is that possible?, Romulo
- Re: CHanging the order of parameters, is that possible?, Dirk Laurie