lua-users home
lua-l archive

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


On Sat, Apr 26, 2014 at 10:16 PM, Coda Highland <chighland@gmail.com> wrote:
On Sat, Apr 26, 2014 at 6:39 PM, Paige DePol <lual@serfnet.org> wrote:
> On Apr 26, 2014, at 5:48 PM, Thiago L. <fakedme@gmail.com> wrote:
>
>>> On Saturday, April 26, 2014, Paige DePol <lual@serfnet.org> wrote:
>>>
>>> Interesting post, however, it does not really address why the architects of Lua chose ~= over != or <> for their "not equals" operator.
>>>
>>> Also, as that post did talk about patches adding bugs, all patches I am creating for Lunia are also patching the Lua test suite to include the new changes, which has helped considerably with ensuring the patches are as robust and bug-free as possible! :)
>>>
>>> ~pmd~
>>
>> I wonder why they don't use "not =" so like "if x not = y then <stuff> end" :3
>
> In that case I would prefer "if x not equal y then <stuff> end" ;)
>
> ~pmd~

But then that would mean you'd say "if x equal y" when it would be
more comfortably "if x equals y", but THEN you end up with "if x not
equals y" and that's getting awkward again. :P

/s/ Adam


But we could reduce some of that awkwardness by using symbols instead: replace "equals" with "=" or "==" and "not" with "~" or "!"... suddenly we're back to the familiar syntax of most languages!

Indeed, ~ and ! are both "not" operators in many languages, so both "~=" and "!=" both read logically as "not equals".

--
Sent from my Game Boy.