lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> 
> > I found now, that the predefined _G is defined in the Standard ctype.h
> > in Darwin/MacOSX
> 
> > This header seems to be the standard header file in BSD-Systems so
> > i suggest to rename the field in the lua_State struct and in the
> > correspondig references!
> 
> Thanks for the warning. We will change that. (Actually we will avoid
> the use of any name starting with '_'.)
> 
> -- Roberto

Well, that may not be needed entirely, AFAIK, according
to the ANSI C standard, only names beginning with two underscores 
or names beginning with with one underscore followed by a capital 
letter are reserved for the internal use of standard libraries. 
/Normally/ you should be able to use names that begin with a 
single underscore followed by a lowercase letter without problems.

The problem with the predefined _G on MacOSX simply boils
down to a conflict of lua C code with the ANSI standard. But,
using something like _g, or better still, _lua_g, is acceptable
and does not violate tthe C standard.


-- 
"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer 
bjorn.demeyer@pandora.be