Lua diffs-lua-5.4.0-beta-rc1-rc2


README

2c2
< This is Lua 5.4.0 (beta), released on 02 Oct 2019.
> This is Lua 5.4.0 (beta), released on 08 Oct 2019.

doc/contents.html

326a327,358
> <H3><A NAME="metamethods">metamethods</A></H3>
> <P>
> <A HREF="manual.html#2.4">__add</A><BR>
> <A HREF="manual.html#2.4">__band</A><BR>
> <A HREF="manual.html#2.4">__bnot</A><BR>
> <A HREF="manual.html#2.4">__bor</A><BR>
> <A HREF="manual.html#2.4">__bxor</A><BR>
> <A HREF="manual.html#2.4">__call</A><BR>
> <A HREF="manual.html#3.3.8">__close</A><BR>
> <A HREF="manual.html#2.4">__concat</A><BR>
> <A HREF="manual.html#2.4">__div</A><BR>
> <A HREF="manual.html#2.4">__eq</A><BR>
> <A HREF="manual.html#2.5.3">__gc</A><BR>
> <A HREF="manual.html#2.4">__idiv</A><BR>
> <A HREF="manual.html#2.4">__index</A><BR>
> <A HREF="manual.html#2.4">__le</A><BR>
> <A HREF="manual.html#2.4">__len</A><BR>
> <A HREF="manual.html#2.4">__lt</A><BR>
> <A HREF="manual.html#pdf-getmetatable">__metatable</A><BR>
> <A HREF="manual.html#2.4">__mod</A><BR>
> <A HREF="manual.html#2.5.4">__mode</A><BR>
> <A HREF="manual.html#2.4">__mul</A><BR>
> <A HREF="manual.html#luaL_newmetatable">__name</A><BR>
> <A HREF="manual.html#2.4">__newindex</A><BR>
> <A HREF="manual.html#pdf-pairs">__pairs</A><BR>
> <A HREF="manual.html#2.4">__pow</A><BR>
> <A HREF="manual.html#2.4">__shl</A><BR>
> <A HREF="manual.html#2.4">__shr</A><BR>
> <A HREF="manual.html#2.4">__sub</A><BR>
> <A HREF="manual.html#pdf-tostring">__tostring</A><BR>
> <A HREF="manual.html#2.4">__unm</A><BR>
> 

628c660
< Mon Sep 30 23:54:47 UTC 2019
> Thu Oct  3 17:35:42 UTC 2019

doc/manual.html

400c400
< under certain special operations.
> under certain events.

402c402
< of operations over a value by setting specific fields in its metatable.
> of a value by setting specific fields in its metatable.

413c413
< In the previous example, the key is "<code>__add</code>"
> In the previous example, the key is the string "<code>__add</code>"

443,462c443,446
< A metatable controls how an object behaves in
< arithmetic operations, bitwise operations,
< order comparisons, concatenation, length operation, calls, and indexing.
< A metatable also can define a function to be called
< when a userdata or a table is garbage collected (<a href="#2.5">&sect;2.5</a>).
< 
< 
< <p>
< For the unary operators (negation, length, and bitwise NOT),
< the metamethod is computed and called with a dummy second operand,
< equal to the first one.
< This extra operand is only to simplify Lua's internals
< (by making these operators behave like a binary operation)
< and may be removed in future versions.
< (For most uses this extra operand is irrelevant.)
< 
< 
< <p>
< A detailed list of events controlled by metatables is given next.
< Each operation is identified by its corresponding key.
> A detailed list of operations controlled by metatables is given next.
> Each event is identified by its corresponding key.
> By convention, all metatable keys used by Lua are composed by
> two underscores followed by lowercase Latin letters.

472,473c456,457
< First, Lua will check the first operand (even if it is valid).
< If that operand does not define a metamethod for <code>__add</code>,
> It starts by checking the first operand (even if it is a number);
> if that operand does not define a metamethod for <code>__add</code>,

480,481c464,465
< Otherwise,
< it raises an error.
> Otherwise, if no metamethod is found,
> Lua raises an error.

588c572
< The result of the call is always converted to a boolean.
> Moreover, the result of the call is always converted to a boolean.

639c623
< (If necessary,
> If needed,

641c625
< to do the assignment.)
> to do the assignment.

653c637
< are the result of the operation.
> are the results of the operation.

660,663c644,662
< It is a good practice to add all needed metamethods to a table
< before setting it as a metatable of some object.
< In particular, the <code>__gc</code> metamethod works only when this order
< is followed (see <a href="#2.5.3">&sect;2.5.3</a>).
> In addition to the previous list,
> the interpreter also respects the following keys in metatables:
> <code>__gc</code> (see <a href="#2.5.3">&sect;2.5.3</a>),
> <code>__close</code> (see <a href="#3.3.8">&sect;3.3.8</a>),
> <code>__mode</code> (see <a href="#2.5.4">&sect;2.5.4</a>),
> and <code>__name</code>.
> (The entry <code>__name</code>,
> when it contains a string,
> is used by some error-reporting functions to build error messages.)
> 
> 
> <p>
> For the unary operators (negation, length, and bitwise NOT),
> the metamethod is computed and called with a dummy second operand,
> equal to the first one.
> This extra operand is only to simplify Lua's internals
> (by making these operators behave like a binary operation)
> and may be removed in future versions.
> For most uses this extra operand is irrelevant.

674a674,682
> <p>
> It is a good practice to add all needed metamethods to a table
> before setting it as a metatable of some object.
> In particular, the <code>__gc</code> metamethod works only when this order
> is followed (see <a href="#2.5.3">&sect;2.5.3</a>).
> It is also a good practice to set the metatable of an object
> right after its creation.
> 
> 

1235c1243
< (with mandatory enclosing brackets),
> (with mandatory enclosing braces),

7075d7082
< (The entry <code>__name</code> is used by some error-reporting functions.)

7569c7576
< The recommendation is to test the success of these functions
> The recommendation is to always test the success of these functions

11084c11091
< it returns <b>false</b>.
> it returns a falsy value.

11701c11708
< Wed Oct  2 21:30:38 UTC 2019
> Tue Oct  8 15:13:21 UTC 2019

doc/readme.html

281c281
< <LI> coersions string-to-number moved to the string library
> <LI> string-to-number coercions moved to the string library

332c332
< Tue Sep 24 16:42:41 UTC 2019
> Thu Oct  3 12:42:49 UTC 2019

src/Makefile

144,145d143
< 	
< 

src/lcode.c

1653,1654c1653,1654
<       /* ELSE *//* FALLTHROUGH */
<     }
>       /* ELSE */
>     }  /* FALLTHROUGH */

src/lcorolib.c

119c119,120
< static const char *statname[] = {"running", "dead", "suspended", "normal"};
> static const char *const statname[] =
>   {"running", "dead", "suspended", "normal"};

src/ldblib.c

27c27
< static const char* HOOKKEY = "_HOOKKEY";
> static const char *const HOOKKEY = "_HOOKKEY";

src/lgc.c

1001c1001
<   static lu_byte nextage[] = {
>   static const lu_byte nextage[] = {

src/loadlib.c

62c62
< static const char *CLIBS = "_CLIBS";
> static const char *const CLIBS = "_CLIBS";

src/lparser.c

1526,1527c1526,1527
<   static OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
<   static OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};
>   static const OpCode forprep[2] = {OP_FORPREP, OP_TFORPREP};
>   static const OpCode forloop[2] = {OP_FORLOOP, OP_TFORLOOP};

src/lstrlib.c

235a236,246
> #if defined(LUA_NOCVTS2N)	/* { */
> 
> /* no coercion from strings to numbers */
> 
> static const luaL_Reg stringmetamethods[] = {
>   {"__index", NULL},  /* placeholder */
>   {NULL, NULL}
> };
> 
> #else		/* }{ */
> 

313a325,326
> #endif		/* } */
> 

src/luac.c

510a511
> 	printf(COMMENT "%s",eventname(c));

512d512
< 	printf(COMMENT); printf("%s ",eventname(c));

515c515
< 	printf(COMMENT); printf("%s ",eventname(c));
> 	printf(COMMENT "%s",eventname(c));

519c519
< 	printf(COMMENT); printf("%s ",eventname(c)); PrintConstant(f,b);
> 	printf(COMMENT "%s ",eventname(c)); PrintConstant(f,b);

638,640c638,643
<    //default: printf("not handled"); break;
< 	//printf("%d %d %d",a,b,c);
< 	//break;
> #if 0
>    default:
> 	printf("%d %d %d",a,b,c);
> 	printf(COMMENT "not handled");
> 	break;
> #endif