diff options
Diffstat (limited to '')
-rw-r--r-- | lua.h | 8 | ||||
-rw-r--r-- | manual/manual.of | 123 | ||||
-rw-r--r-- | testes/all.lua | 2 | ||||
-rw-r--r-- | testes/calls.lua | 2 | ||||
-rw-r--r-- | testes/main.lua | 6 |
5 files changed, 12 insertions, 129 deletions
@@ -17,11 +17,11 @@ | |||
17 | 17 | ||
18 | 18 | ||
19 | #define LUA_VERSION_MAJOR "5" | 19 | #define LUA_VERSION_MAJOR "5" |
20 | #define LUA_VERSION_MINOR "4" | 20 | #define LUA_VERSION_MINOR "5" |
21 | #define LUA_VERSION_RELEASE "5" | 21 | #define LUA_VERSION_RELEASE "0" |
22 | 22 | ||
23 | #define LUA_VERSION_NUM 504 | 23 | #define LUA_VERSION_NUM 505 |
24 | #define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 5) | 24 | #define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 0) |
25 | 25 | ||
26 | #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR | 26 | #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR |
27 | #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE | 27 | #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE |
diff --git a/manual/manual.of b/manual/manual.of index 6d19e251..416622c1 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -1586,7 +1586,8 @@ Each variable name may be postfixed by an attribute | |||
1586 | @producname{attrib}@producbody{@bnfopt{@bnfter{<} @bnfNter{Name} @bnfter{>}}} | 1586 | @producname{attrib}@producbody{@bnfopt{@bnfter{<} @bnfNter{Name} @bnfter{>}}} |
1587 | } | 1587 | } |
1588 | There are two possible attributes: | 1588 | There are two possible attributes: |
1589 | @id{const}, which declares a @x{constant variable}, | 1589 | @id{const}, which declares a @emph{constant} or @emph{read-only} variable, |
1590 | @index{constant variable} | ||
1590 | that is, a variable that cannot be assigned to | 1591 | that is, a variable that cannot be assigned to |
1591 | after its initialization; | 1592 | after its initialization; |
1592 | and @id{close}, which declares a to-be-closed variable @see{to-be-closed}. | 1593 | and @id{close}, which declares a to-be-closed variable @see{to-be-closed}. |
@@ -9118,7 +9119,7 @@ is a more portable solution. | |||
9118 | @simplesect{ | 9119 | @simplesect{ |
9119 | 9120 | ||
9120 | Here we list the incompatibilities that you may find when moving a program | 9121 | Here we list the incompatibilities that you may find when moving a program |
9121 | from @N{Lua 5.3} to @N{Lua 5.4}. | 9122 | from @N{Lua 5.4} to @N{Lua 5.5}. |
9122 | 9123 | ||
9123 | You can avoid some incompatibilities by compiling Lua with | 9124 | You can avoid some incompatibilities by compiling Lua with |
9124 | appropriate options (see file @id{luaconf.h}). | 9125 | appropriate options (see file @id{luaconf.h}). |
@@ -9155,51 +9156,6 @@ change between versions. | |||
9155 | @itemize{ | 9156 | @itemize{ |
9156 | 9157 | ||
9157 | @item{ | 9158 | @item{ |
9158 | The coercion of strings to numbers in | ||
9159 | arithmetic and bitwise operations | ||
9160 | has been removed from the core language. | ||
9161 | The string library does a similar job | ||
9162 | for arithmetic (but not for bitwise) operations | ||
9163 | using the string metamethods. | ||
9164 | However, unlike in previous versions, | ||
9165 | the new implementation preserves the implicit type of the numeral | ||
9166 | in the string. | ||
9167 | For instance, the result of @T{"1" + "2"} now is an integer, | ||
9168 | not a float. | ||
9169 | } | ||
9170 | |||
9171 | @item{ | ||
9172 | Literal decimal integer constants that overflow are read as floats, | ||
9173 | instead of wrapping around. | ||
9174 | You can use hexadecimal notation for such constants if you | ||
9175 | want the old behavior | ||
9176 | (reading them as integers with wrap around). | ||
9177 | } | ||
9178 | |||
9179 | @item{ | ||
9180 | The use of the @idx{__lt} metamethod to emulate @idx{__le} | ||
9181 | has been removed. | ||
9182 | When needed, this metamethod must be explicitly defined. | ||
9183 | } | ||
9184 | |||
9185 | @item{ | ||
9186 | The semantics of the numerical @Rw{for} loop | ||
9187 | over integers changed in some details. | ||
9188 | In particular, the control variable never wraps around. | ||
9189 | } | ||
9190 | |||
9191 | @item{ | ||
9192 | A label for a @Rw{goto} cannot be declared where a label with the same | ||
9193 | name is visible, even if this other label is declared in an enclosing | ||
9194 | block. | ||
9195 | } | ||
9196 | |||
9197 | @item{ | ||
9198 | When finalizing an object, | ||
9199 | Lua does not ignore @idx{__gc} metamethods that are not functions. | ||
9200 | Any value will be called, if present. | ||
9201 | (Non-callable values will generate a warning, | ||
9202 | like any other error when calling a finalizer.) | ||
9203 | } | 9159 | } |
9204 | 9160 | ||
9205 | } | 9161 | } |
@@ -9210,39 +9166,6 @@ like any other error when calling a finalizer.) | |||
9210 | @itemize{ | 9166 | @itemize{ |
9211 | 9167 | ||
9212 | @item{ | 9168 | @item{ |
9213 | The function @Lid{print} does not call @Lid{tostring} | ||
9214 | to format its arguments; | ||
9215 | instead, it has this functionality hardwired. | ||
9216 | You should use @idx{__tostring} to modify how values are printed. | ||
9217 | } | ||
9218 | |||
9219 | @item{ | ||
9220 | The pseudo-random number generator used by the function @Lid{math.random} | ||
9221 | now starts with a somewhat random seed. | ||
9222 | Moreover, it uses a different algorithm. | ||
9223 | } | ||
9224 | |||
9225 | @item{ | ||
9226 | By default, the decoding functions in the @Lid{utf8} library | ||
9227 | do not accept surrogates as valid code points. | ||
9228 | An extra parameter in these functions makes them more permissive. | ||
9229 | } | ||
9230 | |||
9231 | @item{ | ||
9232 | The options @St{setpause} and @St{setstepmul} | ||
9233 | of the function @Lid{collectgarbage} are deprecated. | ||
9234 | You should use the new option @St{incremental} to set them. | ||
9235 | } | ||
9236 | |||
9237 | @item{ | ||
9238 | The function @Lid{io.lines} now returns four values, | ||
9239 | instead of just one. | ||
9240 | That can be a problem when it is used as the sole | ||
9241 | argument to another function that has optional parameters, | ||
9242 | such as in @T{load(io.lines(filename, "L"))}. | ||
9243 | To fix that issue, | ||
9244 | you can wrap the call into parentheses, | ||
9245 | to adjust its number of results to one. | ||
9246 | } | 9169 | } |
9247 | 9170 | ||
9248 | } | 9171 | } |
@@ -9254,46 +9177,6 @@ to adjust its number of results to one. | |||
9254 | @itemize{ | 9177 | @itemize{ |
9255 | 9178 | ||
9256 | @item{ | 9179 | @item{ |
9257 | Full userdata now has an arbitrary number of associated user values. | ||
9258 | Therefore, the functions @id{lua_newuserdata}, | ||
9259 | @id{lua_setuservalue}, and @id{lua_getuservalue} were | ||
9260 | replaced by @Lid{lua_newuserdatauv}, | ||
9261 | @Lid{lua_setiuservalue}, and @Lid{lua_getiuservalue}, | ||
9262 | which have an extra argument. | ||
9263 | |||
9264 | For compatibility, the old names still work as macros assuming | ||
9265 | one single user value. | ||
9266 | Note, however, that userdata with zero user values | ||
9267 | are more efficient memory-wise. | ||
9268 | } | ||
9269 | |||
9270 | @item{ | ||
9271 | The function @Lid{lua_resume} has an extra parameter. | ||
9272 | This out parameter returns the number of values on | ||
9273 | the top of the stack that were yielded or returned by the coroutine. | ||
9274 | (In previous versions, | ||
9275 | those values were the entire stack.) | ||
9276 | } | ||
9277 | |||
9278 | @item{ | ||
9279 | The function @Lid{lua_version} returns the version number, | ||
9280 | instead of an address of the version number. | ||
9281 | The Lua core should work correctly with libraries using their | ||
9282 | own static copies of the same core, | ||
9283 | so there is no need to check whether they are using the same | ||
9284 | address space. | ||
9285 | } | ||
9286 | |||
9287 | @item{ | ||
9288 | The constant @id{LUA_ERRGCMM} was removed. | ||
9289 | Errors in finalizers are never propagated; | ||
9290 | instead, they generate a warning. | ||
9291 | } | ||
9292 | |||
9293 | @item{ | ||
9294 | The options @idx{LUA_GCSETPAUSE} and @idx{LUA_GCSETSTEPMUL} | ||
9295 | of the function @Lid{lua_gc} are deprecated. | ||
9296 | You should use the new option @id{LUA_GCINC} to set them. | ||
9297 | } | 9180 | } |
9298 | 9181 | ||
9299 | } | 9182 | } |
diff --git a/testes/all.lua b/testes/all.lua index a8e44024..279694ae 100644 --- a/testes/all.lua +++ b/testes/all.lua | |||
@@ -3,7 +3,7 @@ | |||
3 | -- See Copyright Notice at the end of this file | 3 | -- See Copyright Notice at the end of this file |
4 | 4 | ||
5 | 5 | ||
6 | local version = "Lua 5.4" | 6 | local version = "Lua 5.5" |
7 | if _VERSION ~= version then | 7 | if _VERSION ~= version then |
8 | io.stderr:write("This test suite is for ", version, | 8 | io.stderr:write("This test suite is for ", version, |
9 | ", not for ", _VERSION, "\nExiting tests") | 9 | ", not for ", _VERSION, "\nExiting tests") |
diff --git a/testes/calls.lua b/testes/calls.lua index cd2696e8..ea384224 100644 --- a/testes/calls.lua +++ b/testes/calls.lua | |||
@@ -448,7 +448,7 @@ print("testing binary chunks") | |||
448 | do | 448 | do |
449 | local header = string.pack("c4BBc6BBB", | 449 | local header = string.pack("c4BBc6BBB", |
450 | "\27Lua", -- signature | 450 | "\27Lua", -- signature |
451 | 0x54, -- version 5.4 (0x54) | 451 | 0x55, -- version 5.5 (0x55) |
452 | 0, -- format | 452 | 0, -- format |
453 | "\x19\x93\r\n\x1a\n", -- data | 453 | "\x19\x93\r\n\x1a\n", -- data |
454 | 4, -- size of instruction | 454 | 4, -- size of instruction |
diff --git a/testes/main.lua b/testes/main.lua index 9187420e..9c8be580 100644 --- a/testes/main.lua +++ b/testes/main.lua | |||
@@ -134,7 +134,7 @@ RUN('env LUA_INIT= LUA_PATH=x lua %s > %s', prog, out) | |||
134 | checkout("x\n") | 134 | checkout("x\n") |
135 | 135 | ||
136 | -- test LUA_PATH_version | 136 | -- test LUA_PATH_version |
137 | RUN('env LUA_INIT= LUA_PATH_5_4=y LUA_PATH=x lua %s > %s', prog, out) | 137 | RUN('env LUA_INIT= LUA_PATH_5_5=y LUA_PATH=x lua %s > %s', prog, out) |
138 | checkout("y\n") | 138 | checkout("y\n") |
139 | 139 | ||
140 | -- test LUA_CPATH | 140 | -- test LUA_CPATH |
@@ -143,7 +143,7 @@ RUN('env LUA_INIT= LUA_CPATH=xuxu lua %s > %s', prog, out) | |||
143 | checkout("xuxu\n") | 143 | checkout("xuxu\n") |
144 | 144 | ||
145 | -- test LUA_CPATH_version | 145 | -- test LUA_CPATH_version |
146 | RUN('env LUA_INIT= LUA_CPATH_5_4=yacc LUA_CPATH=x lua %s > %s', prog, out) | 146 | RUN('env LUA_INIT= LUA_CPATH_5_5=yacc LUA_CPATH=x lua %s > %s', prog, out) |
147 | checkout("yacc\n") | 147 | checkout("yacc\n") |
148 | 148 | ||
149 | -- test LUA_INIT (and its access to 'arg' table) | 149 | -- test LUA_INIT (and its access to 'arg' table) |
@@ -153,7 +153,7 @@ checkout("3.2\n") | |||
153 | 153 | ||
154 | -- test LUA_INIT_version | 154 | -- test LUA_INIT_version |
155 | prepfile("print(X)") | 155 | prepfile("print(X)") |
156 | RUN('env LUA_INIT_5_4="X=10" LUA_INIT="X=3" lua %s > %s', prog, out) | 156 | RUN('env LUA_INIT_5_5="X=10" LUA_INIT="X=3" lua %s > %s', prog, out) |
157 | checkout("10\n") | 157 | checkout("10\n") |
158 | 158 | ||
159 | -- test LUA_INIT for files | 159 | -- test LUA_INIT for files |