lua-users home
lua-l archive

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


>indexing from zero, instead of one?

This would be a complete backwards-compatibility break with little gain.  If you want it, add 1 to your index or subtract 1 from Lua's index.

On Mon, Dec 8, 2014 at 4:20 PM, Rena <hyperhacker@gmail.com> wrote:
On Mon, Dec 8, 2014 at 11:04 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> If I were going to beg for another new feature/change, it'd be for
>> metamethods to be honored in more cases
>
> Lua 5.3 does honor more index metamethods in almost all functions.
> What else do you have in mind?
>

If I'm understanding the manual correctly, lua_tolstring() doesn't
honour __tostring. Similarly lua_tonumberx() doesn't call __tonumber
(if such a metamethod even exists?). The manual also doesn't appear to
specify whether lua_call() will look at __call.

I was also wishing there was lua_geti() and lua_seti(), but it looks
like those did get added at some point. :-) (or were they there all
along and I'm just blind?)

--
Sent from my Game Boy.