Well, got a major blow to my plans today.

I was planning on something akin to a packaging/class system similar to how a lot of object oriented languages work, but I discovered something about how Lua works in WoW that makes it very difficult to do: After each file is finished, it appears that WoW resets the environment to the default global environment. So I can't have environment switches outside of the current file.

Without the ability to use Lua's own environment system outside of the current file, any class/packaging system basically becomes too complex to perform well. Oh well, so much for that idea.

Well, at least I've learned why nobody else appears to have tried to create something similar. It's not something that can be done in a separate library.

But - information hiding is still possible, and the setfenv function still works inside a file. Or I can just type "local" all of the time.

The whole purpose is to avoid name clashes. Something that's been bugging me ever since I took over Reagent Restocker. A large number of bugs that I've encountered can be traced to one addon clobbering a global value that another addon uses. So it's very desirable to put as much as possible in a different environment, where I don't have to worry about name clashes.

For now, it looks like I'm just making stuff private, while I think about another way of doing it. I'll probably just settle on some simple environment switching that can be easily copied and pasted into new files.

There's good news, however: The switch to the new library is pretty much finished. It's functional enough to take it out of alpha and start beta testing. I just need to make a final decision on how to handle name clashes.