lua-users home
lua-l archive

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


>> IMHO if it was to be changed "~=" should be abandoned
>> and all code changed over to "!=". Having two optional
>> forms of ~= would be silly.
>
>Breaking compatibility with older scripts would be even sillier.

Finally, something in this crazy thread I care about. :-)

I'd love to be able to define operators within the language.  Yes this is a
slight pain for the parser, but not terribly so since an "operator" would
just be defined as some sequence of one or more characters from a particular
defined set.  Well, OK, unary operators introduce issues with distinguishing
chains of operations from a multiple character operator, and there's the
whole deduction of unary vs. binary vs. even higher orders.  But, hey lots
of this already had to be handled because of the built in operators (OK
that's still an oversimplification, but I'd REALLY like this).

So, what's the hook to this thread?

Simple, != could replace ~= (in a major version release of course) and ~=
could be mapped to != by a compatibility script.  Cheers :-)