[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: to confirm, userdata can implement the "eq" metamethod, but they are still different table keys?
- From: Sam Roberts <sroberts@...>
- Date: Mon, 30 Apr 2007 18:54:37 -0700
So realistically, if you want (non-mutable) userdata to be equivalent in
the sense of builtin object types, you need to implement some kind of
weak-reference system to avoid creating new userdata if an equivalent
one exists already, in which case you don't need to implement the eq
metamethod anymore, since they will BE the same userdata if they
satisfy "equivalency" rules.
Sam