lua-users home
lua-l archive

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



On 26/04/2014 18:38, Paige DePol wrote:
On Apr 26, 2014, at 4:19 PM, Andrew Starks <andrew.starks@trms.com> wrote:

On Saturday, April 26, 2014, Paige DePol <lual@serfnet.org> wrote:
On Apr 26, 2014, at 6:44 AM, David Demelier <demelier.david@gmail.com> wrote:

2014-04-25 14:57 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:
On Fri, Apr 25, 2014 at 2:54 PM, Coroutines <coroutines@gmail.com> wrote:
How is <> used in Pascal?
It is "not equal".

Also, I would like to see ~= changed to !=.
Apparently ~ is a bitch to type on some keyboards, so allowing it as
an alternative might be an idea (Moonscript does this [1])

I also would like to have != instead of ~=. For many reasons, first
because ~= usually mean "approximatively" and because almost all
popular languages use !=. A beginner programmer will confuse when he
will first see ~=. I don't think there are real reasons to keep this
operator :-).
For Lunia (my custom build of Lua for my game engine) this was literally the first patch I created! ;)

I thought using ~= was a strange choice for not equals, as the tilde, to me, also makes me think "approximate", not "not equal".

What was the rational behind using ~= instead of != for Lua?

~pmd~
  http://lua-users.org/lists/lua-l/2013-02/msg00197.html

Amongst others...
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