lua-users home
lua-l archive

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


Whoa, looks like the crazy size operator is still claiming victims :)

On Sat, Oct 29, 2011 at 11:22 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
>> assert(#T1 == #T2)  -- will fail
>
> You cannot compare tables like that. Two variables containing a table
> will be equal only if they are in fact pointing to the same table, not
> if the table has the same contents. (Unless you changed the behavior
> with metatables)

Not to be nitpicking, but: He compares the sizes here, not the tables
themselves (note the # operator).

Stefan