lua-users home
lua-l archive

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


> Why is the ~= operator the != operator in Lua in the first place? Perhaps 
> someone could share this bit of information?

First, `~=' is not the `!=' operator in Lua. `~=' is the "not equal"
operator ;)

Back in 1993 (when we started Lua) there was no Java, no Python (at
least to a general audience), no Php, Perl was known only to the
initiated. At that time, C-like syntax was not dominant as it is now.

Even today a lot of languages do not use `!=': Ada, Haskell, Eiffel, and
Fortran90 use `/='; Icon, Dylan, Smalltalk (and Lua) use `~='; several
Pascal-based languages use `<>'; Oberon, Modula2, and Modula3 use `#'.

(http://merd.net/pixel/language-study/syntax-across-languages/Vrs.html#Vrsqltnqlt has a nice list of other options.)

-- Roberto