HOW-TO: Convert 5.02 to 5.1
 

News:

11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

HOW-TO: Convert 5.02 to 5.1

Started by TTB, 27 July, 2006, 12:04:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TTB

Hi,

There are a lot of requests to convert scripts from 5.02 to 5.1. Here is a little help (source = http://www.lua.org/manual/5.1/manual.html#7 ). Maybe ppl can try this first on their own instead of requesting before they have even tried.



Here we list the incompatibilities that may be found when moving a program from Lua 5.0 to Lua 5.1. You can avoid most of the incompatibilities compiling Lua with appropriate options (see file luaconf.h). However, all these compatibility options will be removed in the next version of Lua.

7.1 - Changes in the Language

    * The vararg system changed from the pseudo-argument arg with a table with the extra arguments to the vararg expression. (Option LUA_COMPAT_VARARG in luaconf.h.)
    * There was a subtle change in the scope of the implicit variables of the for statement and for the repeat statement.
    * The long string/long comment syntax ([[string]]) does not allow nesting. You can use the new syntax ([=[string]=]) in these cases. (Option LUA_COMPAT_LSTR in luaconf.h.)

7.2 - Changes in the Libraries

    * Function string.gfind was renamed string.gmatch. (Option LUA_COMPAT_GFIND)
    * When string.gsub is called with a function as its third argument, whenever this function returns nil or false the replacement string is the whole match, instead of the empty string.
    * Function table.setn was deprecated. Function table.getn corresponds to the new length operator (#); use the operator instead of the function. (Option LUA_COMPAT_GETN)
    * Function loadlib was renamed package.loadlib. (Option LUA_COMPAT_LOADLIB)
    * Function math.mod was renamed math.fmod. (Option LUA_COMPAT_MOD)
    * Functions table.foreach and table.foreachi are deprecated. You can use a for loop with pairs or ipairs instead.
    * There were substantial changes in function require due to the new module system. However, the new behavior is mostly compatible with the old, but require gets the path from package.path instead of from LUA_PATH.
    * Function collectgarbage has different arguments. Function gcinfo is deprecated; use collectgarbage("count") instead.



Gr, TTB.

TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Markitos

...tutorial TTB!
People can have a look at here too
http://forum.ptokax.org/index.php?topic=6123.0

SMF spam blocked by CleanTalk