[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why I leave Lua (Was: Re: [ANN] Lua 5.3.0 (work3) now available)
- From: Coroutines <coroutines@...>
- Date: Wed, 9 Jul 2014 17:25:45 -0700
On Wed, Jul 9, 2014 at 5:20 PM, Rena <hyperhacker@gmail.com> wrote:
> I forgot to mention, my personal biggest pet peeve of Lua is none of what OP
> mentioned: it's inconsistent metatable honouring in the C API. I understand
> 5.2 and 5.3 have improved some of this but it's still an issue sometimes.
> E.g. lua_isstring/lua_tostring/table.concat not honouring __tostring,
> lua_rawseti but no lua_seti. I've been bit by these a few times before.
You have all my agrees.
Another thing that seemed pretty arbitrary is that __index can be a
table. That table can have a metatable. But the __index of that
table that is the first __index cannot have a metatable. I just
expect things like that to recurse, instead of being a
first-level-only trigger. The same for __newindex.
I also wish __length could be a number for the odd case, requiring it
being a function can be wasteful.
I also wish you could point __ipairs/__pairs at a sequence to use for
keys on the `self'. It would be easy as hell to push some object from
C as userdata, then pair a Lua sequence with it to use as the keys for
ipairs or pairs. I have to make my own generator for that... c'est la
vie