Telegram Group & Telegram Channel
Lua 5.5 Beta 版本发布,新特性包括(但不限于)

- 允许使用 global 关键字声明当前 scope 内可作为全局变量使用的名字,实际属于编译期检查

     X = 1       -- Ok, global by default
do
global Y -- voids implicit initial declaration
Y = 1 -- Ok, Y declared as global
X = 1 -- ERROR, X not declared
end
X = 2 -- Ok, global by default again


应该可以一定程度上缓解不小心创建多余的全局变量的情况。我觉得这是 Lua 5.5 最大的更改之一

- 引入了 table.create 方法,在创建表时可以提供 hint 要求解释器预分配空间。
- 允许通过 lua_pushexternalstring() 在 Lua 解释器直接引用外部创建的字符串对象,对长数据块能够消除一次分配/拷贝消耗

还有部分对现有特性的更改/提升,

- for 循环的控制变量不再可以在循环体内被更改,此前的 Lua 版本修改控制变量会产生未定义行为,Lua 5.5 直接将控制变量标记为了只读
- 允许垃圾回收的老年代收集过程增量完成而无需暂停世界
- 优化了有较大数组部分的表的内存消耗

Reference: https://www.lua.org/work/doc/#changes
Reference: https://www.lua.org/work/doc/manual.html#8



tg-me.com/ziyao233channel/3443
Create:
Last Update:

Lua 5.5 Beta 版本发布,新特性包括(但不限于)

- 允许使用 global 关键字声明当前 scope 内可作为全局变量使用的名字,实际属于编译期检查

     X = 1       -- Ok, global by default
do
global Y -- voids implicit initial declaration
Y = 1 -- Ok, Y declared as global
X = 1 -- ERROR, X not declared
end
X = 2 -- Ok, global by default again


应该可以一定程度上缓解不小心创建多余的全局变量的情况。我觉得这是 Lua 5.5 最大的更改之一

- 引入了 table.create 方法,在创建表时可以提供 hint 要求解释器预分配空间。
- 允许通过 lua_pushexternalstring() 在 Lua 解释器直接引用外部创建的字符串对象,对长数据块能够消除一次分配/拷贝消耗

还有部分对现有特性的更改/提升,

- for 循环的控制变量不再可以在循环体内被更改,此前的 Lua 版本修改控制变量会产生未定义行为,Lua 5.5 直接将控制变量标记为了只读
- 允许垃圾回收的老年代收集过程增量完成而无需暂停世界
- 优化了有较大数组部分的表的内存消耗

Reference: https://www.lua.org/work/doc/#changes
Reference: https://www.lua.org/work/doc/manual.html#8

BY Ziyao Channel | 二代目


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/ziyao233channel/3443

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Among the actives, Ascendas REIT sank 0.64 percent, while CapitaLand Integrated Commercial Trust plummeted 1.42 percent, City Developments plunged 1.12 percent, Dairy Farm International tumbled 0.86 percent, DBS Group skidded 0.68 percent, Genting Singapore retreated 0.67 percent, Hongkong Land climbed 1.30 percent, Mapletree Commercial Trust lost 0.47 percent, Mapletree Logistics Trust tanked 0.95 percent, Oversea-Chinese Banking Corporation dropped 0.61 percent, SATS rose 0.24 percent, SembCorp Industries shed 0.54 percent, Singapore Airlines surrendered 0.79 percent, Singapore Exchange slid 0.30 percent, Singapore Press Holdings declined 1.03 percent, Singapore Technologies Engineering dipped 0.26 percent, SingTel advanced 0.81 percent, United Overseas Bank fell 0.39 percent, Wilmar International eased 0.24 percent, Yangzijiang Shipbuilding jumped 1.42 percent and Keppel Corp, Thai Beverage, CapitaLand and Comfort DelGro were unchanged.

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

telegram from us


Telegram Ziyao Channel | 二代目
FROM USA