|
You probably already know this, but weak tables only work for garbage collected reference types with explicit constructions[1], e.g. tables and userdata, but not numbers, booleans, strings, and light C functions.
The last two implementations listed here[2] don't do that. One uses object equality and some form of lookup tree, while the other uses object identity and nested tables. You should add your implementation to that page after you have fixed the following bug: `func()` and `func(nil)` are mapped to the same signature.