lua-users home
lua-l archive

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


Daurnimator <quae@daurnimator.com> wrote:
> I think they were saying that you could write a metmethod that is not commutive:

I take your point about writing a random or otherwise noncommutative method, but
what Coda said was "in the case where __eq was defined on one and not the
other".

The reason the difference matters to me is that someone who writes a random or
otherwise noncommutative method is (definitely) doing it to themselves. But at
least in previous versions of Lua, the language required basic safeguards by
requiring that both operands "share the same metamethod".[1]

Thanks, Peter

[1]: http://www.lua.org/manual/5.2/manual.html#2.4
-- 
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System