lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thomas Andersen wrote:
I believe that many C++ developers use lua these days.
Although the lua interpreter is written in C, it would be nice if the 3 main
headers had extern "C" declarations in them.
Like this:

#ifdef __cplusplus
extern "C" {
#endif

Lua and C++ are my two favorite languages, yet I disagree with you.

My theoretical argument is that extern "C" is a C++ construct for binding to C modules. There are thousands of computer languages, and any one of them may choose to offer similar functionality for binding to C. Is it Lua's responsibility to bloat its headers with ifdef's and foreign language constructs for each such language?

My practical argument is that a C++ developer seriously using Lua would make a native C++ interface to the Lua library. As a side effect of the wrapper, the extern "C" need only been written in one single place, and that is the end of it.

-John



--
http:// if   l .   /