I'm aware of the weak tables functionality in Lua, however I would like to have a weak reference with a single variable.
I've seen this proposal which suggests an API as follows:
-- creation
ref = weakref(obj)
-- dereference
obj = ref()
which would seem ideal. However this doesn't appear to be in the documentation elsewhere; only weak tables.
Is there something analogous to Python's weak reference to object functionality?