lua-users home
lua-l archive

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

On Jul 9, 2014, at 3:13 PM, Tim Hill <> wrote:

> On Jul 9, 2014, at 10:31 AM, Enrico Colombini <> wrote:
>> On 09/07/2014 16.37, Michel Martens wrote:
>>> As I read the message, all the points stated as downsides are aspects
>>> that I really like about Lua. In the end I think it's correct to sum
>>> it up as a matter of taste ("...probably not for me").
>> My thoughts exactly :-)
>> About ~= I am totally neutral: I do not even remember how the first 'not equal' operator I used looked like (and I have no difficult reading '~' as 'not').
>> -- 
>> Enrico
> Over the years I’ve used .NE. (FORTRAN, yes with the dots), <> with BASIC and dialects, != with C and dialects etc etc. I have no real trouble switching, though I make the odd typo. I’m a little sympathetic to those who point out that tilde is used for “approximate” in many math environments, so it reads a little oddly if you are aware of that. But I don’t think it’s a big deal.
> Anyway, in Lua you can always write “not x == y” :)
> —Tim

It was always <> or != for me, of which I prefer the latter. ~= just looks really odd to me, then again I spent a lot of time in perl where =~ is the the regexp operator. So backwards regexp or "approximately equal" to, neither of which are in Lua and so look strange there. 

I think you mean "not (x == y)", without the brackets you get "(not x) == y" which is probably not what you want.