[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] lua-sophia, binding to the Sophia embeddable key-value database
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 2 Oct 2013 10:09:58 -0300
> __index = db.get,
Oh, I thought you needed to get and set as methods, as in db:get(k).
If not, then your code is much nicer.
> if k == "cursor" then return function() return db:cursor() end
Just do
return setmetatable({
cursor=function() return db:cursor() end
},m)
Then neither __index nor __newindex will be called when the key is "cursor".
- References:
- [ANN] lua-sophia, binding to the Sophia embeddable key-value database, Michal Kottman
- Re: [ANN] lua-sophia, binding to the Sophia embeddable key-value database, Luiz Henrique de Figueiredo
- Re: [ANN] lua-sophia, binding to the Sophia embeddable key-value database, Michal Kottman
- Re: [ANN] lua-sophia, binding to the Sophia embeddable key-value database, Luiz Henrique de Figueiredo
- Re: [ANN] lua-sophia, binding to the Sophia embeddable key-value database, Michal Kottman