lua-users home
lua-l archive

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


On Fri, Sep 16, 2016 at 12:38 PM, Rena <hyperhacker@gmail.com> wrote:
> On Sep 16, 2016 3:13 PM, "Martin" <eden_martin_fuhrspam@gmx.de> wrote:
>>
>>
>>
>> On 16-09-05 12:29 PM, Soni L. wrote:
>> > Lua has 4 forms of negation:
>> >
>> > -
>> > ~
>> > not
>> > ~=
>> >
>> > Yet only 2 of them can be overloaded.
>> >
>> > It's cool that Lua has 4 forms of negation tho.
>>
>> As I understand "-" is for general numbers, "~" for integer numbers,
>> "not" for general logic and "~=" for equivalence logic. From them only
>> "~=" may be dropped and reformulated as "not ==".
>>
>> Also you may count table.insert(), t[#t + 1], "+" and ".." as addition.
>>
>
> "-" is mathematical negation. "~" is bitwise inversion. "not" is boolean
> inversion/negation. "~=" is shorthand for "not ==".

Yes, which means there's three different concepts of negation, not
four, because two of them are the same concept.

/s/ Adam