I had posted this a while back but got no answers so here I am reposting!
I know what a weak table is, just looking for use cases for them.
From my understanding, you can set the values of a table to be weak
with like this:
local x, m = {}, {__mode = 'v'} setmetatable(x, m)
You can also set the keys to be weak with __mode = 'k'
and both the keys and values with __mode = "kv"
.
What are weak tables useful for? Will I find myself using them in the future?