[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ~= vs. !=
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 27 Nov 2003 09:52:19 -0200
> 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