Rawequal: Difference between revisions

From Pico-8 Wiki
Jump to navigation Jump to search
(saf gg fuksvdafgasudkyfgkasuydgfaksdg fyasuk gfyasukfuadsgfvhjkbahsdkhfvbskaudhfvjhgasdvfghjadsvfghvsghbvbhvsdhgbfhgujsdb fuhjsdb fkuhjsvdkhgfvsakghf sghad fvkhgsjdv fghsadvfhasdjfgkjhavshkjd fvkhjasdv fjhkasvfhjvdsfhjvasdhfjkasdjhfvashjkfvajhskdv...)
imported>Felice Enellen
(Adding categories)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
I CAUSED MAYHEM ON BTN AND LUA{{ApiReference
{{ApiReference
|name=rawequal
|name=rawequal
|shortdesc=Compare two tables, bypassing metamethods
|shortdesc=Compare two tables, bypassing metamethods
Line 20: Line 20:
[[Category:Reference]]
[[Category:Reference]]
[[Category:API]]
[[Category:API]]
[[Category:Lua]]

Latest revision as of 22:37, 12 March 2021

rawequal( tbl1, tbl2 )
Compare two tables, bypassing metamethods
tbl1
A table to compare.

tbl2
Another table to compare.

When creating things like custom containers and objects, one often overrides the __eq metamethod with custom code, possibly to to do deep comparisons or to omit certain elements, but might then need to check for regular equality without going through that override. This can be done with rawequal().

See also