Re: Operator precedence and unary minus
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Operator precedence and unary minus
- From: Sean Conner <sean@...>
- Date: 2018年5月21日 19:02:45 -0400
It was thus said that the Great Tim Hill once stated:
>
> You also need to be careful with literals and metatables. Consider:
>
> -a * b
> -10 * b
>
> The same result? But what if b has a __mul metamethod?
>
> —Tim
-10 * b and b has a __mul metamethod equals -Tim?
-spc (Tongue firmly planted in cheek)