Well, cdecl tells the compiler to place the items in C fashion for the methods (functions/procedures). Since Lua is developed in C it expects the method params and return values in C style and not pascal style (more on this all over the web if you want to research it).

Yes, the result of the function is the number of variables that YOU placed onto the stack (or returned). If you have variables in a table then you only count the table .

On the topic of Result, this is something that Borland introduced into the pascal language. The pascal standard states that you should use the method name and not a generic handler . So actually, its Borland Delphi thats wrong .

Finally, hate to burst your bubble, but I am very selective of the people I let work on the game engine. In fact, right now there is only one other person that ever looks at the code, and he doesn't modify it . On most of my projects I don't mind, but this one is close to the heart and has paying customers, so I keep a very tight lid on the source. Though, if you ever decide to do one of your own, feel free to ask questions, as I think I've managed to screw up about everything that could be screwed up .