----- Original Message -----
From: Patrick Donnelly
Date: 12/11/2012 7:26 PM
If we use lua for writing "builtin" commands,
we'll need to export a lot of C functions and writing wrappers like
this is boring and time consuming. Also, assume I export fn(char*,int)
to Lua, then I change the prototype to fn(char*, char*), can Lua spot
all the call sites at compile time (or something) so I can update
If the API calls are generic (don't require special handling), you can
use some preprocessor magic to save time/space.
Since I mostly use C++, thanks to template metaprogramming, I get to register functions like so:

        void SomeExistingFunction(char* str, int num);

luaState->GetGlobals().RegisterDirect("SomeExistingFunction", SomeExistingFunction);

I certainly am not suggesting C++ be used within Git, but in this case, C++ has some nice compile-time advantages.


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to