One bit of elaboration: if you care you can make a C struct tableref {int uid;} and attach a metatype to it to give you some syntactic convenience: mystruct.member_tableref.foo will look up "foo" through the __index method of the tableref's metatype (i.e. looking up the table through uid2tbl and then getting tbl["foo"]). Demetri