Understood, thanks alot as always. It was very beneficial to have it broken down in that way.
I always knew it was a bit backwards.
What I didn't realize though was that it is less efficient than other methods (ie just referencing addonTable direct).
I was never worried about unpack() because the table keys were just 1 and 2, but I'll not be using it anymore. From what you've said, I don't want to be needlessly calling a function every time I reference the tables.
Lua Code:
local addonName, addonTable = ...
local F = {};
local V = {};
addonTable[1] = F;
addonTable[2] = V;
EarthernUI = addonTable;
My intention with the final line is to have a global reference to addonTable. That way, when working on modules, I can easily reference to the table by using something like ...
Lua Code:
local F = EarthernUI[1];
local V = EarthernUI[2];
local c = V.Checks;
local f = V.Frames;
local m = V.Media;
local v = V.IntVars;
... at the start of each module.
Is it okay to do it in this way?