lua-users home
lua-l archive

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


David Jones wrote:

Perhaps it's time to get with the program (evolution
towards Common Lisp, naturally), and embrace EQL, EQUAL,
and EQUALP

I believe that the current situation (one equality operator
and zero or more application-specific equality/equivalence
functions) has a clear advantage in the simplicity
department, especially considering that Lua makes a
syntactical distinction between operators and functions, and
that stock Lua doesn't have multiple numeric types, numbers
that live in the heap, or non-interned strings.  All of the
Lisp-style equality predicates can be written as functions.

How would a Lua equalp operator handle compare table keys
that are tables?[1]  (Common Lisp handles this by each hash
table having a :test function.)

(leaving the abomination EQ in the gutter to die the death
it deserved to get in committee)

Well, it's the primitive that all the others are based on,
so why not expose it?

[1] This is a rhetorical question.  The point is that the
way things are now, people who need this functionality can
decide for themselves how it works, and people who don't
need it don't even have to think about it.

--
Aaron