On Mon, Dec 16, 2013 at 12:33 AM, Philipp Janda <siffiejoe@gmx.net> wrote:
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.
I didn't actually know that :o I think it's just something I never
consciously thought about until you mentioned it... how do those others get
collected? I guess what I wrote still stands for userdata at least? Where
do threads/coroutines stand in that?
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.
[...]
I shall have to add mine to that page sometime, I didn't know memoizing
functions was talked about *there*.