Namespaces
ylixir opened this issue ยท 0 comments
The addon itself should create and live in a namespace.
- the namespace is created with setfenv depth 1
- the addon environment is the table passed by wow for that purpose
- the addon name is the name passed by wow for that purpose
- reading a global variable will read from the global environment
- writing to a global variable will write to the addon environment
- the global environment will be available (for writing) at
_G
- the addon environment will be available through
_G.NubbinNamespaces.{addon name}
The scripts can live in the global namespace for now but we eventually want to move them into _G.NubbinNamespaces["{username}/{scriptname}"]
. Think about whether this breaks anything other than define-global