4 ms·
Very cool! I was just needing something like this for my Defold game, this looks way better than my hacky solution. Semi-unrelated - you say you're using table
by appleorchard46 2y ago
Very cool! I was just needing something like this for my Defold game, this looks way better than my hacky solution.
Semi-unrelated - you say you're using tables as keys in your project. I didn't know you could do that! What are you using it for?
- GranPC 2y agoFWIW anything in Lua can be used as a key - including functions, userdata, etc.
- girvel 2y agoFor example, you want to keep a set of objects -- then the objects themselves would be keys, and values would be true/nil. Or there is a good example in one of ldump's recent issues: https://github.com/girvel/ldump/issues/44 https://github.com/girvel/ldump/issues/44, where the loaded packages are stored in a table as keys to easily detect external module usage.