example.toc
Code:
## Title: example
## Interface: 80000
## blah~
exp1.lua
exp2.lua
exp1.lua
Lua Code:
local _, ns = ...
ns["player"].name = UnitName("Player")
exp2.lua
Lua Code:
local _, ns = ...
print(ns["player"].name) -- It works!
ns["player"].name = "Wrynn" -- It also works!
ns["player"].class = "WARRIOR" -- It doesn't work. It fires nil value error
exp2.lua can access and edit the value that was already defined in
exp1.lua.
but
exp2.lua can't define a new variable into the table 'ns'
Other addons can do this like It was nothing. so I don't know what are the problems with my codes...