Re: __call metamethod, misleading doc or am I missing something?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: __call metamethod, misleading doc or am I missing something?
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2017年2月21日 09:39:39 +0200
2017年02月21日 9:26 GMT+02:00 Tim Hill <drtimhill@gmail.com>:
> If I understand the OP correctly, he is saying that __add() will
> accept a callable, so why not __call()? I haven’t tested this but
> *if* he is correct, then that appears to differ from the Lua reference
> 2.4 that says "Note that queries for metamethods are always raw;
> the access to a metamethod does not invoke other metamethods.”
> So either he is wrong, the Lua ref manual is wrong, or the Lua code
> is wrong (I’m not taking bets here!).
A fourth possibility is that you do not understand what the manual
means by "the access to a metamethod does not invoke other
metamethods.”
I take it to mean that if a metatable itself has metamethods, they (and
in particular another level of _index) will not be invoked when
determining whether a particular metamethod is available.