vector2 = vector1is to set both values to reference the same userdata object. But I would like my math objects to behave like the simple data types, in that assignment makes a *copy* of the object, and changing vector2 would have no effect on vector1. Is there an easy way to accomplish this in Lua? There doesn't seem to be an assignment tag method. The only way I can think to make it work is to create a new userdata object on every call to "settable", but that would generate a lot of garbage. If I could detect the assignment, I could at least use a refcount scheme to only duplicate the necessary objects.
Thanks, Jason