In message <[EMAIL PROTECTED]>, John Labenski <[EMAIL PROTECTED]> writes >On 6/12/07, Alec Ross <[EMAIL PROTECTED]> wrote: >> In message <[EMAIL PROTECTED]>, >> John Labenski <[EMAIL PROTECTED]> writes >> ... >> > >> >2) To avoid any potential function name conflicts since C/C++ cannot >> >have functions start with '_', >> Library functions might. No issues w/ this? > >I don't know what you mean? The binding __index metatable function for >a userdata class checks for a leading '_' on a function call, flags >that the user wants the baseclass function, removes the '_' and then >checks the binding class struct for a C++ function with that name. >So... it's really only checking C++ functions which can never start >with a '_' anyway. > The C++ standard, in 17.4.3.1.2, reserves names beginning with an underscore for implementer use in the global namespace. (As well as explicitly listing names beginning with a double underscore, or an underscore followed by an uppercase letter.) And indeed this is not at all uncommon. So my question was simply about a possible clash between a wxLua use of a leading underscore and use in C++ library implementations.
>The lua code has the ability to name functions it attaches to user >data to anything, so forcing people to not start them with a '_' is >not too much to ask I think. The C++ side, on the other hand, is >inflexible unless we want to get back into having renamed functions. > >Take a look at the bottom of unittest.wx.lua for some examples of it. >Specificly, "Test adding a methods..." and "Test virtual class >functions...". >http://wxlua.cvs.sourceforge.net/wxlua/wxLua/samples/unittest.wx.lua?vie >w=markup > >I think this is pretty simple and clean, do you agree? > Yes, very much so, IMHO. >Regards, > John Labenski > >------------------------------------------------------------------------- >This SF.net email is sponsored by DB2 Express >Download DB2 Express C - the FREE version of DB2 express and take >control of your XML. No limits. Just data. Click to get it now. >http://sourceforge.net/powerbar/db2/ >_______________________________________________ >wxlua-users mailing list >wxlua-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/wxlua-users -- Alec Ross ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users