I know rawset() and rawget() I just don’t know how to use rawequal() any help thanks
It’s probably like rawget(arg) == rawget(arg)
You can use that function to equal a metatable without calling the metatables __eq function.
1 Like
It isn’t working
function idk(one, two)
print(rawget(one) == rawget(two))
end
idk(“Red”, “Green”)
Rawget expects 2 things, a table and an index to get from that table.
Again, rawequal
is used to check if 2 things are equal without invoking the __eq metamethod of metatables. It is required if you set up an __eq metamethod
At the end of this article, it mentions all three of the raw functions, rawset
, rawget
and rawequal
, and their use cases, although it mentions rawset only, it still gives enough info as to why the others also have to be used in your metatables
1 Like