[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua life after integers
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 8 Dec 2014 20:20:40 -0200
> 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.
All core metamethods are honored in the Lua API, except for those
functions that are named *raw*. Both the API functions and the VM
instructions ultimately use the same code. The core metamethods
are listed in http://www.lua.org/work/doc/manual.html#2.4 .
__tostring is not a core metamethod, nor are __pairs and __ipairs.
So, lua_tolstring does not honor __tostring. luaL_tolstring does.