On Sat, 8 Sep 2012 18:56:41 +1000 David Seikel <[email protected]> wrote:
> On Sat, 8 Sep 2012 11:32:52 +0300 "Alex-P. Natsios" > <[email protected]> wrote: > > > Greetings people, > > > > just forwarding this here, along with a patch by Dennis Schridde > > with compatibility fixes ( Lua 5.1 -> Lua 5.2). > > > > ( i added him on CC too since he is not on the list ). > > > > ---------- Forwarded message ---------- > > From: Dennis Schridde <[email protected]> > > Date: Sat, Sep 8, 2012 at 1:30 AM > > Subject: [PATCH] Edje r76321 Lua 5.2 compatibility > > To: [email protected] > > > > > > Hi! > > > > I ported Edje r76321 to compile and run with Lua 5.2. Please find > > the patch attached. Please CC me, as I am not on the list (drakevr > > just proxied this email for me). > > > > The changes have been tested with lua_script.edc and I could not > > notice a change in behaviour and only minor changes in the console > > output (minor differences in timestamps and coordinates). > > > > Necessary changes for Lua 5.2 compatibility were: > > * lua_objlen was renamed to lua_rawlen > > * luaL_register was removed, as Lua discourages modules setting > > globals now. I replaced it with one of two ways (depending on the > > context): > > - Where libname is NULL, I simply call luaL_setfuncs. There is no > > change in functionality. > > - Where libname was not NULL, I create a global table and call > > luaL_setfuncs on it. > > This gets the job done, but is not equivalent to luaL_register. > > If you want to be stricter (in case you load the same module > > multiple times, for example), luaL_requiref should be called with a > > luaopen_* function, which should call luaL_newlib. The result of > > luaL_requiref should then be set via lua_setglobal. > > > > Necessary changes for Lua 5.1 compatibility were: > > * table.getn(t) was replaced by the #t operator > > > > Best regards, > > Dennis > > I'll have a look at this next week. I have had a quick look so far. On my Lua 5.1 equipped development work station, it compiles fine, the example runs fine, and my actual application that uses Lua seems to work fine (not fully tested yet). Not tested it with an actual Lua 5.2 yet. As raster mentioned in the other Lua thread, it needs a lot of testing. So this is just the beginning, but so far so good. Also needs some careful review, which I'll get to later in the week, or next week. I'll likely commit it next week as well, unless there's some major problem I spot that's not easily fixed. The lua_objlen -> lua_rawlen is not just a simple rename from what I understand. Will have to check if any change in behaviour is important in our usage of that. table.getn(t) was actually replaced by #t in 5.1, then deprecated. That part of the example was really old I think. Perhaps Dennis could join this mailing list, so he can participate in the other recent Lua thread? Which is really where this discussion belongs. "edje: lua >= 5.2" that thread is called. -- A big old stinking pile of genius that no one wants coz there are too many silver coated monkeys in the world.
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
