History

Lua 5.2.2-rc3

Lua Team committed 13 years ago

Commit 46b413e1 parent 3552fc54 files · +16 −11Browse files

Unified · Split

4 files
  1. README +1 −1
  2. doc/manual.html +12 −5
  3. src/lmathlib.c +2 −2
  4. src/ltablib.c +1 −3
README+1−1
@@ -1,5 +1,5 @@
1 1
2This is Lua 5.2.2, released on 22 Feb 2013.2This is Lua 5.2.2, released on 7 Mar 2013.
3 3
4For installation instructions, license details, and4For installation instructions, license details, and
5further information about Lua, see doc/readme.html.5further information about Lua, see doc/readme.html.
doc/manual.html+12−5
@@ -33,7 +33,7 @@ Freely available under the terms of the · 32 unmodified lines
33<!-- ====================================================================== -->33<!-- ====================================================================== -->
34<p>34<p>
35 35
36<!-- $Id: manual.of,v 1.101 2013/02/15 12:33:36 roberto Exp $ -->36<!-- $Id: manual.of,v 1.102 2013/03/07 18:25:28 roberto Exp $ -->
37 37
38 38
39 39
@@ -8412,10 +8412,17 @@ Note that the resulting table may not be a sequence. · 8372 unmodified lines
8412 8412
8413<p>8413<p>
8414Removes from <code>list</code> the element at position <code>pos</code>,8414Removes from <code>list</code> the element at position <code>pos</code>,
8415shifting down the elements8415returning the value of the removed element.
8416When <code>pos</code> is an integer between 1 and <code>#list</code>,
8417it shifts down the elements
8416<code>list[pos+1], list[pos+2], &middot;&middot;&middot;, list[#list]</code>8418<code>list[pos+1], list[pos+2], &middot;&middot;&middot;, list[#list]</code>
8417and erasing element <code>list[#list]</code>.8419and erases element <code>list[#list]</code>;
8418Returns the value of the removed element.8420The index <code>pos</code> can also be 0, when <code>#list</code> is 0,
8421or <code>#list + 1</code>;
8422in those cases, the function erases the element <code>list[pos]</code>.
8423
8424
8425<p>
8419The default value for <code>pos</code> is <code>#list</code>,8426The default value for <code>pos</code> is <code>#list</code>,
8420so that a call <code>table.remove(t)</code> removes the last element8427so that a call <code>table.remove(t)</code> removes the last element
8421of list <code>t</code>.8428of list <code>t</code>.
@@ -10490,7 +10497,7 @@ Here is the complete syntax of Lua in extended BNF. · 2068 unmodified lines
10490<HR>10497<HR>
10491<SMALL CLASS="footer">10498<SMALL CLASS="footer">
10492Last update:10499Last update:
10493Tue Feb 19 16:28:19 BRT 201310500Thu Mar 7 15:36:34 BRT 2013
10494</SMALL>10501</SMALL>
10495<!--10502<!--
10496Last change: revised for Lua 5.2.210503Last change: revised for Lua 5.2.2
src/lmathlib.c+2−2
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: lmathlib.c,v 1.82 2013/01/29 16:00:40 roberto Exp $2** $Id: lmathlib.c,v 1.83 2013/03/07 18:21:32 roberto Exp $
3** Standard mathematical library3** Standard mathematical library
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -160,7 +160,7 @@ static int math_frexp (lua_State *L) { · 154 unmodified lines
160 160
161static int math_ldexp (lua_State *L) {161static int math_ldexp (lua_State *L) {
162 lua_Number x = luaL_checknumber(L, 1);162 lua_Number x = luaL_checknumber(L, 1);
163 lua_Number ep = luaL_checknumber(L, 2);163 int ep = luaL_checkint(L, 2);
164 lua_pushnumber(L, l_mathop(ldexp)(x, ep));164 lua_pushnumber(L, l_mathop(ldexp)(x, ep));
165 return 1;165 return 1;
166}166}
src/ltablib.c+1−3
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: ltablib.c,v 1.64 2013/02/06 18:29:03 roberto Exp $2** $Id: ltablib.c,v 1.65 2013/03/07 18:17:24 roberto Exp $
3** Library for Table Manipulation3** Library for Table Manipulation
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -70,8 +70,6 @@ static int tremove (lua_State *L) { · 64 unmodified lines
70 int pos = luaL_optint(L, 2, size);70 int pos = luaL_optint(L, 2, size);
71 if (pos != size) /* validate 'pos' if given */71 if (pos != size) /* validate 'pos' if given */
72 luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds");72 luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds");
73 else if (size == 0) /* empty table? */
74 return 0; /* return nothing (nil) */
75 lua_rawgeti(L, 1, pos); /* result = t[pos] */73 lua_rawgeti(L, 1, pos); /* result = t[pos] */
76 for ( ; pos < size; pos++) {74 for ( ; pos < size; pos++) {
77 lua_rawgeti(L, 1, pos+1);75 lua_rawgeti(L, 1, pos+1);