lua-users home
lua-l archive

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


On Thu, Dec 05, 2013 at 06:18:12AM +0000, Thomas Jericke wrote:
> On 12/05/2013 01:23 AM, Jerome Vuarand wrote:
> >2013/12/3 Thomas Jericke <tjericke@indel.ch>:
> >>now and then.
> >Are we really asking for Lua to drop one of its core features (the
> >extremely modest dependency on ANSI C and nothing more) for a corner
> >case useful "now and then" or for very few people like the OP?
> >
> 
> No, I don't.
> And if you read my post again you will see that I ask for a compiler 
> define that can be used to switch Lua to C99 type definition. The 
> default would be the same as now. It might be useful for those who have 
> a C99 compiler at hand but don't want to patch the Lua source 
> themselves. For me it doesn't matter I patch my Lua source the way I 
> want it, and try to not change the language for the end user at the same 
> time.

I think the problem is luaconf.h. Read it over carefully. The only features
that are mutable are binary (add or don't add). You can't redefine
fundamental macros, only enable or disable them. I believe this is done to
guarantee that the implementation and modules agree on the same ABI.

Fundamentally, Lua needs a way to _compile_ luaconf.h at build/install time.
That would require M4 or something similar.

What might be useful is a careful restructing of luaconf.h which maintains
the existing semantics in C, but which also can be preprocessed with M4. For
example, hide some default definitions inside an M4 comment which is
transparent to C, but in which a way that if you run it through M4 with your
preferred values it still comes out as legal C. This would require an extra
level of indirection in defining constants, though.