Re: lua equality operator
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: lua equality operator
- From: David Jones <drj@...>
- Date: 2006年8月30日 11:37:46 +0100
On 30 Aug 2006, at 11:15, Christopher Lux wrote:
hi,
i am new to this mailing list. so hello ;)
i am working on some scripting functionality for my application. i
chose lua for various reason, one being its simplicity. now i ran
into an problem with lua, namely the function of the equality
operator. it is impossible to overload it for userdata types (i am
using luabind). i can't define the == operator for my classes to
work with for example int, float or string literals. this is
because lua only uses the == operator for objects of the same type.
i found the lua patch [1] on lua-users.org which solves this. is
planned to work such a patch into future lua?
i think it would be a very powerful addition which ohter scripting
languages (like python) support and would make lua even better.
Perhaps it's time to get with the program (evolution towards Common
Lisp, naturally), and embrace EQL, EQUAL, and EQUALP (leaving the
abomination EQ in the gutter to die the death it deserved to get in
committee). The people who like lots of numeric types can also throw
= (I suppose it would == in Lua) into the mix.
drj