Originally Posted by Phanx
Just put them in your addon's namespace. There's no reason to make everything a global. For example, if this is what you have now:
Code:
-- File A
function MyAddon_DoThings()
print("Doing things.")
end
-- File B
MyAddon_DoThings()
Change it to:
Code:
-- File A
local ADDON, private = ...
function private:DoThings()
print("Doing things without globals!")
end
-- File B
local ADDON, private = ...
private:DoThings()
|
On one end it's pretty genious that it's so simple, on the other end it's confusing as hell if you're used to other languages.