lua-users home
lua-l archive

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


This gets messy with mutable objects because their equivalence (via __eq)
could change with time.

Assume initially that A and B are not equivalent.

T = { }
T[ A ] = "One"
T[ B ] = "Two"

Now change something so that they are equivalent.

What is the value of T[ A ]? T[ B ]?

What if we introduce a third object C that is equivalent to A and B. What is
the value of T[ C ]? What happens when we assign T[ C ] = "Three"?

Mark