[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Detecting read or write access in __index metamethod
- From: Marc Balmer <marc@...>
- Date: Thu, 16 Dec 2010 21:06:00 +0100
Am 16.12.10 21:01, schrieb Luiz Henrique de Figueiredo:
>> hdf.bset = {}
>> for n = 1, res:ntuples() do
>> hdf.bset[n] = {}
>> hdf.bset[n].id = res:getvalue(n, 1)
>> hdf.bset[n].name = res:getvalue(n, 2)
>> hdf.bset[n].description = res:getvalue(n, 3)
>> end
>
> This can be simplified to
>
> hdf.bset = {}
> for n = 1, res:ntuples() do
> hdf.bset[n] = {
> id = res:getvalue(n, 1),
> name = res:getvalue(n, 2),
> description = res:getvalue(n, 3)
> }
> end
For some reason this does not work. Must be my C code.... Or Lua
accesses the fields in a different order.