Yes, it's a WTF, it really shouldn't be like that.
It really should be something like:
[code]
MyAddon =
{
AddonCommands = {"/Masc", "/MASlashCommand" }
}
function MyAddon.SlashCommand(Argument)
DoSomeStuff;
end
SlashCmdList["MyAddon"] = MyAddon;
[/code]
Or if you wanted to get fancy:
[code]
MyAddon =
{
function SlashCommand1(Argument)
DoSomeStuff;
end
function SlashCommand2(Argument)
DoSomeOtherStuff;
end
AddonCommands = {{"/Masc", SlashCommand1}, {"/MASlashCommand", SlashCommand2}}
}
SlashCmdList["MyAddon"] = MyAddon;
[/code]
The second is just off the top of my head, I mess around with Lua and the syntax might be a little off, but it gets the point across.
The problem is that they've redesigned the architecture for the Lua UI several times since the release of the game. When they do that they leave a lot of cruft in to keep as many things backwards compatible as possible so people don't have to relearn things.
A lot of the people making UI mods for WoW aren't programmers and some of the code is really scary. That's the main problem behind the WoW UI and the reason it freezes sometimes, it's not really the a problem with the GC as much as with anyone making a UI mod and not doing things the best way possible because they don't know how. That and the UI programming in general is a huge organic mess.