[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3 features (was Re: [Proposal] -DLUA_NOCONVF2I and -DLUA_NOCONVI2F)
- From: Martin <eden_martin_fuhrspam@...>
- Date: Thu, 21 Jul 2016 11:12:36 -0700
On 16-07-21 12:17 AM, Dirk Laurie wrote:
> I like having the metamethods available for objects and strings.
> For example,
>
> animal = 'pig' | 'dog' | 'cat'
>
> can be defined to mean what you can see it should mean, wheres
> using a Lua 5.2 arithmetic operator would produce a 'wat?' feeling.
This produces 'wat?' feeling for me too. If it's not ABNF rule but lua
code. To understand I have to find place where __bor metamethod is
introduced and what exactly it do.
With metamethods you can no longer be sure even what such code is doing:
"person.name = 'Adam'" because there may be __newindex method.