lua-users home
lua-l archive

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


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