[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.3.0 Compile-time Customization Suggestions
- From: Hisham <h@...>
- Date: Thu, 11 Jul 2013 15:22:59 -0300
On 10 July 2013 07:43, John Hind <firstname.lastname@example.org> wrote:
> I'd like to suggest two very minor changes to the Lua source code to make
> life easier for people making compile-time customizations:
> 1. In 'luaconf.h': At the end of the file instead of / as well as the 'Local
> configuration' comment, add:
> #if defined(LUA_USERCONFIG_H)
> #include LUA_USERCONFIG_H
> This will allow customisations to be made here without editing the
> distribution file, making maintenance easier. This is the same technique
> already used in 'lua.h'.
> 2. In 'lua.h': Modify the LUA_VERSION macro definition as follows:
> #if defined(LUA_VARIANT)
> #define LUA_VERSION LUA_VARIANT "Lua " LUA_VERSION_MAJOR "."
> #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
> This allows prefixing of the _VERSION string to indicate a variation from
> 'standard' lua. There may be a more elegant way to do this, but you get the
I oppose this. There's code out there that assumes that
_VERSION:sub(5) outputs the API version number of Lua. Any "variant"
shouldn't pollute _VERSION for the same reason that
LUA_VERSION_RELEASE does not figure in _VERSION: code shouldn't need
to know about the Lua patch version or "variant" they're running
under, and promoting the definition of "Lua variants" as a core
feature will further dillute the API. (Variant-specific code can
always expose their own detection methods, such as "jit and
jit.version" for LuaJIT).