3333<!-- ====================================================================== -->
3434< p >
3535
36- <!-- $Id: manual.of,v 1.143 2015/01/02 13:07:38 roberto Exp $ -->
36+ <!-- $Id: manual.of,v 1.146 2015/01/06 11:23:01 roberto Exp $ -->
3737
3838
3939
@@ -429,7 +429,7 @@ <h2>2.4 – <a name="2.4">Metatables and Metamethods</a></h2>
429429with the following code:
430430
431431< pre >
432- rawget(getmetatable(obj) or {}, event_name)
432+ rawget(getmetatable(obj) or {}, "__" .. event_name)
433433</ pre >
434434
435435< p >
@@ -761,12 +761,12 @@ <h3>2.5.1 – <a name="2.5.1">Garbage-Collection Metamethods</a></h3>
761761it is not collected immediately by the garbage collector.
762762Instead, Lua puts it in a list.
763763After the collection,
764- Lua goes through that list:
764+ Lua goes through that list.
765765For each object in the list,
766- it checks the object's < code > __gc</ code > metamethod;
767- if it is a function,
768- Lua calls it with the object as its single argument.
769- If the metamethod is not a function,
766+ it checks the object's < code > __gc</ code > metamethod:
767+ If it is a function,
768+ Lua calls it with the object as its single argument;
769+ if the metamethod is not a function,
770770Lua simply ignores it.
771771
772772
@@ -2217,6 +2217,11 @@ <h3>3.4.9 – <a name="3.4.9">Table Constructors</a></h3><p>
22172217 end
22182218</ pre >
22192219
2220+ < p >
2221+ The order of the assignments in a constructor is undefined.
2222+ (This order would be relevant only when there are repeated keys.)
2223+
2224+
22202225< p >
22212226If the last field in the list has the form < code > exp</ code >
22222227and the expression is a function call or a vararg expression,
@@ -2785,7 +2790,7 @@ <h2>4.6 – <a name="4.6">Error Handling in C</a></h2>
27852790< p >
27862791The panic function runs as if it were a message handler (see < a href ="#2.3 "> §2.3</ a > );
27872792in particular, the error message is at the top of the stack.
2788- However, there is no guarantees about stack space.
2793+ However, there is no guarantee about stack space.
27892794To push anything on the stack,
27902795the panic function must first check the available space (see < a href ="#4.2 "> §4.2</ a > ).
27912796
@@ -2861,7 +2866,7 @@ <h2>4.7 – <a name="4.7">Handling Yields in C</a></h2>
28612866 }
28622867</ pre > < p >
28632868Now we want to allow
2864- the Lua code being ran by < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > to yield.
2869+ the Lua code being run by < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > to yield.
28652870First, we can rewrite our function like here:
28662871
28672872< pre >
@@ -2880,7 +2885,7 @@ <h2>4.7 – <a name="4.7">Handling Yields in C</a></h2>
28802885which should do all the work that the original function
28812886was doing after calling < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > .
28822887Now, we must inform Lua that it must call < code > k</ code > if the Lua code
2883- begin running by < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > gets interrupted in some way
2888+ being executed by < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > gets interrupted in some way
28842889(errors or yielding),
28852890so we rewrite the code as here,
28862891replacing < a href ="#lua_pcall "> < code > lua_pcall</ code > </ a > by < a href ="#lua_pcallk "> < code > lua_pcallk</ code > </ a > :
@@ -4179,7 +4184,7 @@ <h2>4.8 – <a name="4.8">Functions and Types</a></h2>
41794184< pre > int lua_pcallk (lua_State *L,
41804185 int nargs,
41814186 int nresults,
4182- int errfunc ,
4187+ int msgh ,
41834188 lua_KContext ctx,
41844189 lua_KFunction k);</ pre >
41854190
@@ -10774,7 +10779,7 @@ <h1>9 – <a name="9">The Complete Syntax of Lua</a></h1>
1077410779< HR >
1077510780< SMALL CLASS ="footer ">
1077610781Last update:
10777- Fri Jan 2 11:29:40 BRST 2015
10782+ Tue Jan 6 10:10:50 BRST 2015
1077810783</ SMALL >
1077910784<!--
1078010785Last change: revised for Lua 5.3.0 (final)
0 commit comments