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 @@
11
2−This is Lua 5.2.2, released on 22 Feb 2013.
2+This is Lua 5.2.2, released on 7 Mar 2013.
33
44 For installation instructions, license details, and
55 further 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
3333 <!-- ====================================================================== -->
3434 <p>
3535
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 $ -->
3737
3838
3939
@@ -8412,10 +8412,17 @@ Note that the resulting table may not be a sequence. · 8372 unmodified lines
84128412
84138413 <p>
84148414 Removes from <code>list</code> the element at position <code>pos</code>,
8415−shifting down the elements
8415+returning the value of the removed element.
8416+When <code>pos</code> is an integer between 1 and <code>#list</code>,
8417+it shifts down the elements
84168418 <code>list[pos+1], list[pos+2], &middot;&middot;&middot;, list[#list]</code>
8417−and erasing element <code>list[#list]</code>.
8418−Returns the value of the removed element.
8419+and erases element <code>list[#list]</code>;
8420+The index <code>pos</code> can also be 0, when <code>#list</code> is 0,
8421+or <code>#list + 1</code>;
8422+in those cases, the function erases the element <code>list[pos]</code>.
8423+
8424+
8425+<p>
84198426 The default value for <code>pos</code> is <code>#list</code>,
84208427 so that a call <code>table.remove(t)</code> removes the last element
84218428 of list <code>t</code>.
@@ -10490,7 +10497,7 @@ Here is the complete syntax of Lua in extended BNF. · 2068 unmodified lines
1049010497 <HR>
1049110498 <SMALL CLASS="footer">
1049210499 Last update:
10493−Tue Feb 19 16:28:19 BRT 2013
10500+Thu Mar 7 15:36:34 BRT 2013
1049410501 </SMALL>
1049510502 <!--
1049610503 Last change: revised for Lua 5.2.2
src/lmathlib.c+2−2
@@ -1,5 +1,5 @@
11 /*
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 $
33 ** Standard mathematical library
44 ** See Copyright Notice in lua.h
55 */
@@ -160,7 +160,7 @@ static int math_frexp (lua_State *L) { · 154 unmodified lines
160160
161161 static int math_ldexp (lua_State *L) {
162162 lua_Number x = luaL_checknumber(L, 1);
163− lua_Number ep = luaL_checknumber(L, 2);
163+ int ep = luaL_checkint(L, 2);
164164 lua_pushnumber(L, l_mathop(ldexp)(x, ep));
165165 return 1;
166166 }
src/ltablib.c+1−3
@@ -1,5 +1,5 @@
11 /*
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 $
33 ** Library for Table Manipulation
44 ** See Copyright Notice in lua.h
55 */
@@ -70,8 +70,6 @@ static int tremove (lua_State *L) { · 64 unmodified lines
7070 int pos = luaL_optint(L, 2, size);
7171 if (pos != size) /* validate 'pos' if given */
7272 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) */
7573 lua_rawgeti(L, 1, pos); /* result = t[pos] */
7674 for ( ; pos < size; pos++) {
7775 lua_rawgeti(L, 1, pos+1);