lua-users home
lua-l archive

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


On Sun, Jan 9, 2022 at 1:02 PM Egor Skriptunoff wrote:
I'd prefer some sort of @+, @-, @/, @%, @//, @^, @= for integer operators.

There is no need to introduce new metamethods for these operators.
It's enough to introduce the third argument for the attribute prepended to the operator sign.
So, multiple attributes may coexist in the language.
"x = y + z" will invoke "__add(y, z)"
"x = y @+ z" will invoke "__add(y, z, '@')"