[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Coercion to string does not call metamethod (Was: Lua minus null (-0)
- From: HyperHacker <hyperhacker@...>
- Date: Sun, 12 Jun 2011 16:24:06 -0600
On Sun, Jun 12, 2011 at 13:42, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> So what is a core metamethod, and why is this one different?
>
> A core metamethod is one supported by the core. __tostring is something
> tostring offers and some other library functions use. It is not a core
> metamethod because it is defined by a library function.
>
>
I think the point is getting lost in a loop here... In my opinion, for
__tostring not to be honoured by lua_tostring() is an annoying
inconsistency. It sounds like you're saying the reason for that is
that __tostring is only used by tostring() - i.e. the very
inconsistency I'm referring to? Why can't it be a core metamethod, if
that's necessary for it to work like the others?
--
Sent from my toaster.