[elinks-dev] Re: Re: Re: Re: Bug#255871: [patch] Lua 5 compatibility

Miciah D.B. Masters miciah at myrealbox.com
Sun Jun 27 20:49:14 PDT 2004


On 20040627 13:13:35, Petr Baudis <pasky at ucw.cz> wrote:
> Dear diary, on Sun, Jun 27, 2004 at 02:24:07AM CEST, I got a letter,
> where "Miciah D.B. Masters" <miciah at myrealbox.com> told me, that...
> > On 20040626 14:59:21, Petr Baudis <pasky at ucw.cz> wrote:
> > > Dear diary, on Sat, Jun 26, 2004 at 10:54:00AM CEST, I got a letter,
> > > where "Miciah D.B. Masters" <miciah at myrealbox.com> told me, that...
> > > > Index: contrib/lua/hooks.lua.in
> > ...
> > > Could you please add this patch to contrib/lua ?
> > 
> > That is an awful solution, but I don't know what is better.
> > We could put the API compatibility code in lua5-compat.lua
> > and instructions on converting the upvals in another file.
> > We can commit the removal of |ret| without loss of Lua 4
> > compatibility.  How does that sound?
> 
> Uh. Well, I have no real Lua clue, so feel free to do anything as long
> as Lua4 still works.

So, we'll leave it Lua 4-compatible with instructions
on porting to Lua 5?

> > > > Index: src/scripting/lua/core.c
> > ...
> > > Couldn't we have this committed with some surrounding #ifdef ?
> > 
> > Check whether #ifdef lua_tablibopen or similar?
> 
> I don't think we can rely on lua_tablibopen() being a macro (is it
> anyway?). 
> it seems like Lua is horrible enough not to bother to define any usable
> one. (At least Lua4 doesn't, I don't have Lua5 installed.)

It is a compatibility macro in Lua 5 for a function in Lua 4.

>           I more thought about checking some macro with Lua version, but
> it seems like Lua is horrible enough not to bother to define any usable
> one. (At least Lua4 doesn't, I don't have Lua5 installed.)

> > Can autoconf can take care of this?
> 
> Sure it can.

   % < /usr/include/lua50/lua.h sed -n -e 17p
   #define LUA_VERSION     "Lua 5.0.2"

Is there similar for Lua 4? I suppose that configure can parse that.

If there is no rush, I'll do this next week.

 -- Miciah <miciah at myrealbox.com>



More information about the elinks-dev mailing list