swig/swig — pull request #144 by v-for-vandal (2014-03-02 15:57:56+00:00)
Title: Class p1 fixes

Hi again.

These are some fixes:
1) I've fixed example.MyWorld.Nested.Dweller.MALE example. Actually I have made it an example in the Examples/lua/nspace directory and copy-pasted working code back to docs.
2) Replaced "Backward compatibility -> Compatibility note"

And some questions (yeah, yeah. I am probably annoying you with questions and objections a lot. Sorry, cant really do anything about it :( )
1) __Static : I deliberately chose names that are forbidden in C++ - that is guarantee that there will never be names clash. See lua.cxx:1332. I am just afraid that if I replace __Static with SwigStatic, then there will be some ~~idiot~~ user who would like to swig-wrap the following his code:
```c++
class UserClass {
class SwigStatic { // Why can't I name my class SwigStatic ? You didn't patent those words!
const int bla_bla_bla;
};
};
```
There will be a clash between my pseudo-generated key for UserClass static methods and key for SwigStatic nested class. I am being overly-cautious, of course, but that was the reason why I chose non-valid C++ names.

3) Enums in C mode - right now in C mode enums are exported into global namespace. So even now you could write (see enums.ctest)
```
print(example.TEST1)
```
instead of example.Test.TEST1. The extra-binding into Test class namespace in C mode was added because I thought that nobody actually wants enums to be only in global namespace. Should not be hard to remove it, actually, so if you confirm, I'll do it.