Compare Two Indexed Tables

same = util.cmpi(t1, t2)

Compares two indexed tables by checking the first level values.

Parameter Type Description
t1 table First table
t2 table Second table
Returns Type Description
same boolean true if they are equivalent.

[!caution[
Only compares first levels, and not sub-tables.

Example:

xx = {1,2,3}
xy = {1,2,3}
util.cmpi({9,8,7,xx}, {9,8,7,xx}) --> true
util.cmpi({9,8,7,xx}, {9,8,7,xy}) --> false (because different tables)

Note that xy has the same internal values as xx, but xy is not the same as xx and the compare does not extend to sub tables.