lua-users home
lua-l archive

Re: Operator precedence and unary minus

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


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)

AltStyle によって変換されたページ (->オリジナル) /