[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.gsub and table replacements
- From: Matthew Wild <mwild1@...>
- Date: Fri, 27 Jan 2012 13:39:30 +0000
On 27 January 2012 11:21, HyperHacker <hyperhacker@gmail.com> wrote:
> On Fri, Jan 27, 2012 at 04:20, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
>>> to make this work, you need to wrap the lookup:
>>
>> Or do
>> params = {["1"]='file.c', ["2"]='file.o'}
>>
>
> Well yes, but that isn't always feasible, e.g. with the {...} example.
setmetatable({...}, { __index = function (t, k) return rawget(t,
tonumber(k)); end })
Regards,
Matthew